Monday 15 February 2010

Combine pairs to groups [PHP / Arrays] -


I have added items to the PHP array Example:

  & lt ;? Php $ element = array ('tiger' = & gt; lion ',' car '= & gt;' bike ',' lion '= & gt;' zoo ',' truck '= & gt;' plane '); ? & Gt;  

Now I want to combine these objects so that all the items connected in any way go to one group. Continuing the example given above:

  & lt ;? Array ('car', 'bike'), 2 = & gt; array ('tiger', 'lion', 'zoo'), 1 = & gt; array (' Do you know how to get it?  

I'm looking for a function Which does this.

  & lt;? $ $ Element = array ('tiger '= & Gt;' lion ',' car '= & gt;' bike ',' lion '=> gt; zoo' 'truck' = 'gt;' plane '); $ groups = array; Forex currency ($ element = $ $ such as value $ & gt; $ val) {$ appended = false; foreach ($ group & $ group) {i F ($ group [0] == $ key) {array_unshift ($ (group $ $) = $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ Array (3) [$ 0] => String (3) "Zoo" [1]   
 

returns:

  array (3) {[0] => = & gt; string (4) "lion" [2] => string (5) "tiger"} [1] = & gt; & Amp; array (2) {[0] => string (4) "bike" [1] => string (3) "car"} [2] = & gt; array (2) {[0] = & Gt; String (5) "plane" [1] = & gt; String (5) "Truck"}}  

objective c - Cocoa move to parent from a subclassed instance -


I have a subclassed NSTextField to limit the maximum length (1 character only). Now, once the user enters this character, I want to take Focus to the next NSTTXTV. This is the place where I need some help. How can I apply the application "Take the focus to the next field"? I think I need to call the original view from the subclassed NSTextField, like something:

  [[parent] next KYV];  

But how do I do this?

about how [[auto window] makefrent responder: [self's next review] ] ?


osx - Why does Mac OS sometimes launch the wrong binary when I click on a .app -


I created this application which contains several binary files (let's say X, Y and Z). I have one. Plist file which specifies that the X should be launched when the app is opened. Everything works well at 99.9% time, but occasionally, it launches another binary (Y or Z).

This usually happens after some crashes in my application, so I guess it's a Mac OS system that detects that something went wrong in binary and try to make a different effort Please.

This is very bad for me because my application becomes unusable as long as I do not uninstall it and restore it.

If these additional binaries have just been launched to do some work in your app, then any There is also no reason that if you are not already storing them in the resource folder inside the app bundle for the main binary in your app bundle for your app bundle, then you can try to give them a place in the macode folder where Main binary i think is that Whatever the mechanism is launching a separate binary instead of the main one, they will hide enough.


c# 3.0 - C# 3.0 Tuple Equivalents (for poor men) -


I find myself occasionally in C # 3.0, searching for ways to emulate Tupl's concept . Over time, I have implemented many "poor people", some of them are here:

Original Object Array :

  Object [] Bad Tupale = New Object [] {EF, Bar, Falcon}; // Original object array  

more strongly typed , hello ...

  KeyWellPear & amp; type; Type A; Key val peer; Type B, Type C & gt; & Gt; PoorTuple;  

Applying a class which can be used to guess the type (raised from)

  public stable Class tuple {public stationary tubal & lt; T1, T2 & gt; & Lt; T1 foo, t2 times & gt; {New Tupal & lt; T1, T2 & gt; (Af, bar); }} // later: var data = tubel. Cret ("foo", 42);  

Question:

  1. Any other methods (or language of choice which lacks data structure) in C # 3.0 for a poor man's tubal

  2. What is the best method to get a tube in C # 3.0 - if anyone has a library recommendation then welcome it is.

  3. At what point (yes, generalization for me) does it mean to make a specific type instead of something like a list or a tuple? (Search of thumb rules)

You can create anonymous types Exclude useful names, do the same as Tuples:

  Child items with my items = myObjects. Select (x = & gt; new {name = x.Name, count = x.Children.Count ()});  

Isolating picture attachment from email with php -


I am using the following php script and to receive the email later to handle different pieces Put in the variable From stdin $ fd = fopen ("php: // stdin", "r") / p>

  #! / Usr / bin / php -q & lt ;? Read php //; $ Email = ""; While (! FIF ($ FD)) {$ email = Fread ($ fd, 1024); } Fclose ($ fd); // handle email $ line = explosion ("\ n", $ email); // empty wars $ = ""; $ Theme = ""; $ Header = ""; $ Message = ""; $ Partition head = true; ($ I = 0; $ i & lt; Count ($ rows); $ i ++) {if ($ splittingheaders) {// This header is $ header = $ Lines [$ i] "\ N"; // See for special headers (preg_match ("/ ^ subject: (. *) /", $ Lines [$ i], $ matches)) {$ subject = $ matches [1]; } If (preg_match ("/ ^ to: (. *) /", $ Rows [$ i], $ matches) {$ from = $ matches [1]; }} And {// not the title, but the message $ message. = $ Rows [$ i]. "\ N"; } If (trim ($ rows [$ i]) == "") {// blank line, header section $ splittingheaders = false has expired; }}  

Where I start to accept a photo attachment and separate it in a variable, I can process it but I need it.

I will use MimeMailParse () then you can just say

 $ Parser = new MimeMailParser (); $ Parser-> setStream (STDIN); // handle image $ path = '/ tmp /'; $ Filename = ''; $ Attachment = $ parser-> gettip (); Foreign Currency ($ attachments as $ attachments) {if (preg_match ('/ ^ image /', $ attachment-> content_type, $ match)) {$ pathinfo = pathinfo ($ attachment-> file name); $ Filename = $ pathinfo ['filename']; If ($ fp = fopen ($ path. $ Filename, 'w')) {while ($ byte = $ enclosure-> read ()) {fill ($ fp, $ bytes); } Fclose ($ fp); }}} 

asp.net - How to turn on line number tooltip while scrolling infragistics ultrawebgrid -


I once saw this feature in action, but I do not know how to turn it on. While dragging the scrollbar, the grid can show the tooltip with the current line number (or line id) it helps you to stop scrolling in the right place. I'm assuming that some property will change on this, but I can not find it. Maybe it's also dependent on scroll mode?

Update: You can see an example of tooltip in the image below. The scrollbar is dragging (up or down) The number of tooltip is the number of lines (you can not see it in this picture, on the left in the grid) this is the same grid which I am using now. Either way this tooltip was stopped by the very old construction of our product. And no one knows how to turn it back: (I'm pretty sure this is a feature of ultra webbread, there is nothing that requires extra coding.

We have now found that you have version 6.3, P>

Then try this code:

  Web Grid. I have met once a while, I think the Virtual Sketch The scrolling is not added as a feature.  

DisplayLayout.XmlLoadOnDemandType = XmlLoadOnDemandType.Virtual;

As you scroll down, it will automatically Put the tooltip on the grid. Take a look for the running spec ... (and remember to select the virtual option)

Here's hope!

Rob G


new operator - How to have line breaks in XML attributes? -


I have a feature: Description and I want to put it in the following with new lines:

This is the content description section.
Download Instructions:
Content is downloading content.
Hotline Support:
This is hotline for content.

How do I create a new line for it in XML?

Actually you want to enter the CRLF:

CR code: & Amp; # 13; LF code: & amp; # 10;

& lt; Myelement description = "line1 and amp; # 13; and # 10; line 2 & amp; # 13; & amp; # 10; line3" />

c++ - How to get IP address from sockaddr -


After accepting I want to try the client's IP address. This is what I have done so far, but I just end up having a few long numbers that clearly do not know an IP. What could be wrong?

  int tcp_sock = socket (AF_INET, SOCK_STREAM, 0); Sockaddr_in Client; Client.sin_family = AF_INET; Socklen_t c_len = sizeof (customer); Int acc_tcp_sock = Accepted (TCP_sock, (Socadar *) and Client, & amp; c_len); Cout & lt; & Lt; "Connect to:" & lt; & Lt; Client.sin_addr.s_addr & lt; & Lt; Endl;  

that long number is the IP address, form in integer (An IP address is just an integer, after all, when people separate octets and split it into dot notation, it is easy to use).

To change the integer value into standard dot notation.


Java Sockets over WLAN? -


I have 2 windows which is connected to an advertisement-HOC wlan network.
By using this current connection, can I communicate between the two sockets of PC? Can I open a server socket on a PC and make another PC a customer and connect to another PC and then send and receive data on this connection? Do I need a specific API for this? Or should I just type java.net.Socket and java.net.ServerSocket ?

Of course you can have an IP network over the WLAN connection, and you need to set up a TCP connection Does not even stop.

As far as the sockets are concerned, this is no different than the wired (ethernet) connection, difference


java - Out of memory error while creating huge XML -


Because of the Java heap space on java.lang.AbstractStringBuilder.expandCapacity (unknown source) Java: java.lang. OutOfMemoryError .lang.AbstractStringBuilder.append on java.io.StringWriter.write (unknown source) java.lang.StringBuffer.append (unknown source) at com.ctc.wstx.sw.BufferingXmlWriter.flushBuffer (unknown source) (BufferingXmlWriter. java: 1358) com.ctc.wstx.sw.BufferingXmlWriter.flush (BufferingXmlWriter.java:224) com.ctc.wstx.sw. com.ctc.wstx.sw.BufferingXmlWriter.close (on BufferingXmlWriter.java:198) On BaseStreamWriter._finishDocument com.ctc.wstx.sw.BaseStreamWriter.close (BaseStreamWriter.java:264) to (BaseStreamWriter.java:1429) on org.codehaus.stax2.ri.Stax2EventWriterImpl.close (Stax2EventWriterImpl.java:178) organization .utils.JcoFunctionToXmlTransformer.transform (JcoFunctionToXmlTransformer.java:163

the goal - to XML to convert back by SAP as the data JcoTable
problem - java.lang.OutOfMemoryError : Java Stack Space

When the data is too big, in such cases where the number of rows in excess of 25,000 is getting more than the error we are facing the same. Ksmel as nodes and to convert XML to read node stream and external custom code problems while (using Jaco API method to use) using stacks API

You can increase the memory limit of JMM by saying:

  java-xmx512m ... < / Code> 

or

  java-xmx1024m ...  

or whatever size you want

Note that you may need to modify your algorithm, for example to serialize XML directly into the output stream, first do not create a large memory structure and then from that to output the stream to serial (It all depends on the details of what the code is doing.)

I had a case similar to this year where I created XML in stringbuffer And was then Stringbfr was writing an HTTP response OutputStream. As long as no 200 MB asked for XML, it works fine! I soon changed the code to generate the XML to the outputstream, not only saved the memory, but the CPU


sql - Getdate() returning same value at different times! What is happening? -


Against the table with 1 million records, giving the same value for the following SQL run, date 1 date and date 2 column Is it, and it is 38 seconds to execute it is a required behavior and why?

  Make Fn_Test (@ a decimal) Return the table as return (SELECT @ one parameter, gatedate (date 1, partition test. * From partition); SELECT *, GETDATE () Date 2 Fn_Test (RAND (DATEPART, GETDATE ())))  

Is this any type of caching?

Yes, SQL semantics are not required that a non-deterministic function that can be evaluated on the current line Does not depend on for each line it is allowed to evaluate the function once and return the same value for all subsequent rows.


event handling - Handle tilt left / right in WPF -


How can I tweak left or tilt correct mouse events in WPF?

I find out how to apply WndProc in WPF UserControl. UserControl will receive a window pointer in my example by AppendWindow method:

  Private Static MyUserControl instanceWithFocus; Public Zero Upland Window (Window Window) {HwndSource Source = HwndSource.FromHwnd (New WindowInteropHelper (Window). Handle); Source Eidhook (new HDWSourceHook (WDPRC)); } Private Static IntPtr WndProc (IntPtr hwnd, integer message, IntPtr wParam, IntPtr lParam, ref handled bool) {Switch (MSG) {Case Win32Messages.WM_MOUSEHWHEEL: MouseWheelTilt (wParam, lParam); Handled = true; break; Default: Break; } Return IntPtr.Zero; } Private static zero MouseWheelTilt (IntPtr wParam, IntPtr lParam) {Int32 tilt = (int16) Utils.HIWORD (wParam); Int32 key = Utill. Talwar (WPAM); Int32 x = Util Sword (lParam); Int32 y = Utilis Ford (lParam); // If an event calls on the active example of this object, then (instanceWithFocus = null!) {InstanceWithFocus.MouseWheelTilt (tilt, keys, X, Y); }} Private Zero MouseWheelTilt (Int32 Tilt, Int32 Keys, Int32 X, Int32 Y) {scrollViewer.ScrollToHorizontalOffset (scrollViewer.HorizontalOffset + Tilt); } Private Zero User ControlMouse (Object Sender, MouseInventErgus E) {instanceWithFocus = this; } Private Zero User ControlMouse LEV (Object Sender, MouseInventErgus E) {instanceWithFocus = null; } Intangible class Win32Messages {public const int WM_MOUSEHWHEEL = 0x020E; } Abstract class Utils {Internal Static Int32 HIWORD (IntPtr ptr) {Int32 val32 = ptr.ToInt32 (); Return ((val32> & gt; 16) & amp; 0xFFFF); } Internal Fixed Ent 32 Lowered (Intit PTR) {Int32 val32 = ptr.ToInt32 (); Return (val32 and 0xFFFF); }}  

c# - DataBind listBox selected item to textboxes -


मेरे पास सूचीबॉक्स डेटा उपयोगकर्ताओं की सूची में बाध्य है (संग्रह):

  usersListBox.DataSource = नल; UsersListBox.DataSource = _users; UsersListBox.DisplayMember = "नाम"; UsersListBox.ValueMember = "आईडी";  

अब मुझे चयनित आइटम की संपत्तियों को अलग-अलग पाठ बक्से में दिखाया जाना है, इसलिए मैं बाध्यकारी हूं:

  nameTextBox.DataBindings.Add ("Text ", यूज़र्स लिस्टबॉक्स। चुने गए आईटम," नाम "); LoginTextBox.DataBindings.Add ("पाठ", usersListBox.SelectedItem, "लॉगिन");  

जब फॉर्म लोड होता है तो मैं देख सकता हूँ कि चुने हुए मदों के मूल पाठ बॉक्स में दिखाई देते हैं, लेकिन जब सूचीबॉक्ड में चयनित आइटम बदल जाता है, तो टेक्स्ट बॉक्स में मान अभी भी समान होते हैं। क्या मुझे चुने हुए को चुना जाना चाहिए सूचीबॉक्स की बदलकर और पाठ बॉक्सों की बाध्यता को दोहराएं? या मुझे कुछ याद आ रहा है और पाठ बॉक्स में मूल्यों को चयनित आइटम को बदलने के साथ बदलना चाहिए?

अगर किसी को जवाब देने की आवश्यकता है: आपको बाध्यकारी स्रोत ऑब्जेक्ट बनाना होगा और उसे सूची बॉक्स और टेक्स्ट बॉक्स असाइन करना होगा: / P>

  usersBindingSource = नया बाध्यकारी संसाधन (); UsersBindingSource.DataSource = _presenter.Users; UsersListBox.DataSource = usersBindingSource; UsersListBox.DisplayMember = "नाम"; UsersListBox.ValueMember = "आईडी"; NameTextBox.DataBindings.Add ("पाठ", usersBindingSource, "नाम", सच, DataSourceUpdateMode.OnPropertyChanged); LoginTextBox.DataBindings.Add ("पाठ", usersBindingSource, "लॉगिन", सच, DataSourceUpdateMode.OnPropertyChanged);  

image - How can I bend a a display object? -


I want to make a collage,

Example: (1.4 mb);

I want to divert the pictures as 3.

There is no easy way to do this. Any solution to this problem will involve a lot of experimentation and cleverness.

For the 3D aspect of change, check the paraphrasection. For the 'turning point' of the transition, check the Displacement Map filter.

Good luck!


jsp - jQuery timepicker invoke on img click -


For now the jQuery timepicker component is implemented. Click on input.

This is the timepiece configured:

  & lt; Script & gt; ... oScript.text + = "var timid = '#' + '& lt; Portlet: namespace / & gt; + '_time'; "; OScript.text + = "$ j (timeID) .timePicker ({startTime: new date (0, 0, 0, 0, 0), step: 30});"; ... & lt; / Script & gt;  

This is a JSP part for Timeplicor (input with a specific ID):

    

So it works fine.

If click on IMG, then this JS error is unhappy, this ID is not "defined", but the ID is equally identical as the rendered HTML

img The code for the tag has been modified so that to open Timepecker:

    

tried ID with quote, same result.

Is it absolutely possible for Timepicker? I mean start with it onClick.

I do not want to answer anymore.

He needs to pay attention to the input just by clicking on the image:

   


python - Inheriting methods from a metaclass -


The example encoding given in

has been reproduced below, implemented in TOKEN Why does __ include __ and __ repr __ to metaclass enumeration type ? Ctypes import * class EnumerationType (type (c_uint) from the

 : Def __new__ (metacls, name, bases, dict): If not, then for the "_members_" key: _members_ = {} For the key, dict.items () value: if not key.startswith ("_"): _members_ [key] = key ["_ members_"] = _members_cls = type (c_uint) .___ key (metacples, name , Sockets, dict) for values, values ​​in cls_members_.items (): globals () [key] = return values ​​CLD DIF __ particles __ (self, value): return value in self. _members_.values ​​() def __repr __ (self): return "& lt; counting% s>" % Self.__name__ class Enumeration (c_uint): __metaclass__ = EnumerationType _members_ = {} def __init __ (self, value): for k, self._members_.items () in itself: if v == value: self.name = K break Other: value increment (no counting member with "value% r") c_uint .__ init __ (self, value) @ paramamethod def -param (CLS, Ultimate): ifinstance (Ultimate, calculation): If the ultimate .__ class__! = Cls: Increase ValueError ("Counting members can not be mixed") and: return the ultimate and return: class (absolute) def __repr __ (self): return "& lt; Member% s =% d of% r & Gt; " % (Self.name, self.value, self.__ class__) class token (enumeration): _members_ = {'T_UNDEF': 0, 'T_NAME': 1, 'T_NUMBER': 2, 't_string': 3, 'T_OPERATOR I would expect to throw the effect by the following code which is included in  __  

Code> In spite of this, I get the True False .

  print in token, 7 in tokens  

enumeration and TOKEN are EnumerationType :

  & gt; & Gt; & Gt; Isinstance (counting, enumeration type) true & gt; & Gt; & Gt; Eustace (token, enumeration type) is true  

and, e.g. repr (TOKEN) is equal to type (token) .__ repr __ (TOKEN) , which is the enumerationType .__ repr __ (TOKEN) .


Append a Lists Contents to another List C# -


मेरे पास निम्न है:

  1. ग्लोबल एसटीइंग नामक एक मुख्य सूची

एक अन्य सूची

  ग्लोबलश्रेस्टिंग = नई सूची & lt; स्ट्रिंग & gt; (); (X = 1; x & lt; 10; x ++) के लिए {localStrings = नई सूची & lt; स्ट्रिंग & gt ;; स्थानीय शब्दों। जोड़ें ("कुछ मान"); स्थानीय शब्दों। जोड़ें ("कुछ मान"); // संभवतः जितनी आसानी से ग्लोबलश्रेस्टिंग को स्थानीय शब्दों को जोड़ना चाहते हैं}  

  ग्लोबलश्रेस्टिंग .AddRange (localStrings);  

नोट: आप इंटरफ़ेस (IList) का उपयोग करके सूची वस्तु को घोषित नहीं कर सकते।


c# - DDD "View Objects"? -


Viewing the application, which includes, say, companies, I can have a company class. I will have Data Access Layer, which is a list & lt; Company & gt; Populates. However, it will happen at times (like displaying search results) where I only need to display the company name, telephone and postcode properties, and I think it is useless to populate the whole company object with all their properties.

In the context of DDD design, what will be the correct way about this? Do I want to look at specific sections, such as the company searchResult Object which only displays the properties that I am interested in displaying?

It looks like a proper approach for me.

Later, if you have some code for the customer SearchResult - If you are crazy like nearby ice cream shops, you can compare your domain object. It would be a very easy time to add your CompanySearchResult to


openoffice.org - Open Office Spreadsheet (Calc) - Concatenate text cells with delimiters -


I am using open-spread spreadsheets program and I am trying to match several text cells with delimiter . For example, suppose I have cells below me:

  + -------- + | Cell 1 + -------- + | Cell 2 + -------- + | Cell 3 + -------- + | Cell 4 + -------- + | Cell 5 + -------- +  

I would like to add them to the delimiter so that the result is in the same cell:

  + --- ------------------------------------------- + | (Cell 1), (cell2), (cell3), (cell 4), (cell 5) + ------------------------- --------------------- +  

My first thought was to try a macro or something, but not me It seems that the Open Office supports those people. Any ideas?

Thanks a lot for finding a solution on this.

Here are some slightly more detailed instructions for the benefit of OpenOffice Basic New Newfone, as it applies to version 3.1 itself:

Tools -> Macros -> Macros Organize -> OpenOffice Basic ...

Now choose from the Explorer tree where you want your function to be live, such as it may be in your own macro library (micros / standard) or in the current spreadsheet Directly stored Can.

Now enter a new macro name and click new to open the OOG original IDE. You will see a REME statement and some stub sub definitions. Delete all and replace it with:

  function STRJOIN (optional, delimiter in the form of a string, alternate alternate form of string), the colon, If the Ismissing (delimiter) then the isamissing (delimiter), then if the (if first) IsMissing is the first = "" end if if after IsMissing (after) = "end" if not ifmissing (Range) So if not IsArray (Category) then result = First & amp; Range & amp; For the line = LBound (range, 1) Ubound (category, 2) cell = range (line, call) for col = l bound (range, 2) for Ubound (category, 1) if cell & lt; & Gt; 0 and lane (trim (cell)) & lt; & Gt; 0 Then if the result is & lt; & Gt; "" Result = result & amp; Delimiter end if result = result & amp; First & amp; Category (line, call) & amp;  

The code above has some minor improvements from the origin of Marcus:

  • The first cell in the range is empty when not before a limit it happens.

  • Allows alternative options of delimiter ("," "default for"), and which are before and after each blank entry in the wire range (by default "").

  • I named it "STRJOIN" because "function" The common name of this function is in many popular languages ​​like Perl, Python and Ruby.

  • All lowercase variables

To save the macro now, go to the cell in which you want to join to join, And type:

  = STRJOIN (C3: C50)  

to move the C3 you want to add.

To customize the delimiter, use something instead:

  = STRJOIN (C3: C50; "/")  

If you want to join a group of email addresses, you can use it:

  = STRJOIN (C3: C50; ","; "& LT; ";" & Gt; ")  

and the result will be something

    

Does DotNetNuke have anything similar to Drupal's CCK? -


I am creating a content website whose basic element is not just plain text but structures with many fields. I want to be based on Open Source CMS so that I want to extend it as I want to.

The CCK module of Drupal gives me exactly what I want, and I am trying to understand if I can get this ability with DNN (or I have to code myself). Most of my company's developers work in .NET languages, I have an important advantage for working with DNN.

You can look in one of the following DNN modules:

The other one looks like more powerful, but unlike the first, it is not free.


What is the best php/js script for cropping/resizing images? -


On a site, I have to upload images and have to crop them manually. There is a script, so I can crop them without reloading the page (so I can easily integrate), and it only cross image space as $ _POST value (via JS form submission) Will pass?

Edit - I mean that JS is used to send crop dimensions (through AJAX), then get returned data (such as crop file name), which is then in the form ( Post / received)

Yahoo! There is an Image Cropper widget in the UI Wii JavaScript Library:


.NET for Windows 7 -


I have a new one. 7 Want to take advantage of Taskbar functionality in a NAT application and would like to know what people think is the best way for the features of Windows 7 in .NET. My aim is to have separate code for Windows XP and Windows 7.

I'm not seriously anxious:

  • Wrap Windows 7 code in just a try.
  • If OS = "Windows 7" then ..

Of course this is what most are doing. I have actually hunted everywhere for a good perspective but without the success Microsoft unmanaged code wrapper library is just running on Windows 7 ... if anything with OS = "Windows 7" " Not sure if

  • this is if the OS and gt; = "Windows 7" (so that it does not break into Windows 7.1 or whatever successor) and
  • This probe should be done by (platform and> = version).

If you do not want to dislodge your code with (ifWindows7) {...} , you put the platform-specific code in a different class You can. For example, you can create an interface

  interface IOSSpecific {void AddToJumpList (...); ...}  

and two implementations of this class, one => win 7 and one for others (which is not a different thing or anything) when your application begins, So you introduce some global variables of IOSSpecific with one of two codes.


exception - Java, ASM org.objectweb.asm.util.CheckClassAdapter causes Unsupported major.minor version 0.0 -


मुझे निम्नलिखित अपवाद मिल रहा है:

  java.lang.UnsupportedClassVersionError: net / sourceforge / बारबेक्यू / BarcodeException: ** असमर्थित MAJOR.MINOR संस्करण 0.0 ** java.lang.ClassLoader.defineClass (ClassLoader.java:621) java.lang.ClassLoader.defineClass पर पर java.lang.ClassLoader.defineClass1 (मूल निवासी विधि) (कम से java.lang.ClassLoader.loadClassInternal पर java.lang.ClassLoader.loadClass (ClassLoader.java:252) पर pl.wroc.pwr.judy2.master.TestClassLoader.loadClass (TestClassLoader.java:51) पर ClassLoader.java:466) java.lang.Class.getConstructor0 (Class.java:2699) पर java.lang.Class.privateGetDeclaredConstructors पर java.lang.Class.getDeclaredConstructors0 (मूल निवासी विधि) (Class.java:2389) पर (ClassLoader.java:320) पर java.lang.Class.getConstructor (Class.java:1657) junit.framework.TestSuite.getTestConstructor (TestSuite.java:83) junit.framework.TestSuite पर है & lt पर;। init & gt; (TestSuite.jav । एक: 131) org.junit.internal.runners.JUnit38ClassRunner पर & LT; init & gt; (org.junit.internal.builders.JUnit3Builder.runnerForClass (JUnit3Builder.java:14 पर JUnit38ClassRunner.java:67)) org.junit पर। Org.junit.runners.model.inter.model.RunnerForClass पर (runnerbuilder.java: runner.model.RunnerBuilder.safeRunnerForClass (RunnerBuilder.java:57) org.junit.internal.builders.AllDefaultPossibilitiesBuilder.RunnerForClass (AllDefaultPossibilitiesBuilder.java29) पर। 57) org.junit.internal.requests.ClassRequest.getRunner (ClassRequest.java:24) junit.framework.JUnit4TestAdapter पर है & lt पर;। init & gt;। (JUnit4TestAdapter.java:31) junit.framework.JUnit4TestAdapter पर & LT; init & gt; (JUnit4TestAdapter.java:24) pl.wroc.pwr.judy2.util.JUnitTestRunner.runTest पर (JUnitTestRunner.java:26)  

नीचे स्रोत कोड के साथ कुछ बाइटकोड लिखने का प्रयास करते समय (सटीक होने के लिए, मुझे यह अपवाद मिलता है जब मैं संशोधित बाइटकोड निष्पादित करने की कोशिश कर रहा हूं)

  सार्वजनिक बाइट [] उपकरण (बाइट [] बाइटकोड) {क्लास रीडर सीआर = नया कक्षा रीडर (बायटेकोड); क्लासवाटर cw = नया क्लासवायर (सीआर, 0); // नया वर्ग एडॉप्टर बनाएँ AbstractInstrumentClassAdapter ca = नया उपकरण क्लास एडाप्टर ट्रेसर (सीडब्ल्यू, ट्रेसर); // System.out.println ("----------------------------------- Daikon start"); Cr.accept (सीए, 0); क्लासरेडर सीआर 2 = नया क्लासरेडर (सीडब्ल्यूटीबोएटेएरे ()); क्लासवाटर cw2 = नया क्लासवायर (सीआर 2, 0); क्लासएडैप्टर चेकर = नया चेकक्लास एडेप्टर (सीडब्ल्यू); AbstractInstrumentClassAdapter ca2 = नया इंस्ट्रूमेंट क्लास एडेप्टरइनस्ट्र्रामर (चेकर); Cr2.accept (चेकर, 0); वापसी cw2.toByteArray (); }  

मैंने सोचा कि यह मेरा InstrumentClassAdapterInstrumenter कार्यान्वयन हो सकता है, इसलिए मैं इसे छोड़ दिया और मैं इस समय केवल CheckClassAdapter का उपयोग कर रहा हूं। क्या कोई देख सकता है कि मैं क्या कर रहा हूं?

चीयर्स,

एलओएल, अंत में जैसा कि मैंने यहां कुछ सवाल पूछा है, यह साधारण टाइपिंग त्रुटि है, होना चाहिए

  कक्षा वाटर सीडब्ल्यू 2 = नया क्लासवायर (सीआर 2, 0); क्लासएडैप्टर चेकर = नया चेकक्लास एडेप्टर (सीड 2);  

नहीं

  कक्षा वाटर सीड 2 = नया क्लासवायर (सीआर 2, 0); क्लासएडैप्टर चेकर = नया चेकक्लास एडेप्टर (सीडब्ल्यू);  

internationalization - viewing translations in django templates (e.g - making it work) -


I am trying to find a deggengo translation system, so I wrote a little test app. I made translation files and compiled them (* .po and * .mo), and now I am trying to render a template in a different language. I translate LANGUAGE_CODE into my settings / other language code, but the template still renders in English. No error has been given, I can not see another language which I am trying to do, even if I translated, Compiled and all these I have also used the get_current_language in the template: whatever I need, I have used DB to support.

  {% load i18n%} {% get_current_language LANGUAGE_CODE%} {% get_available_languages LANGUAGES%} {% is the current language of LANGUAGE_BIDI%} as {{LANGUAGE_CODE}}  

but I'm getting blank where the code should be visible. What am I missing? Thank you.

This is probably one of the two problems:

  1. Make sure you have the settings in django.core.context_processors.i18n . TEMPLATE_CONTEXT_PROCESSORS

  2. Ensure that you use <<>

If you are providing your template, then context_instance as RequestContext (request)

Can I create a asp.net webform -or user control- output from an XML file by using XSLT? -


Actually what I would like to achieve is to produce a form with some check boxes in which their texts will be , The default value should be an xml file with an default value assigned to 3 checkboxes (use sword, use shield, spelling, as a result of the block below). And when that form is posted back, I can read them on the code behind the APX page.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Root & gt; & Lt; Checkbox & gt; & Lt; ID & gt; UseSword & lt; / Id & gt; & Lt; Captions & gt; Use the sword & lt; / Caption & gt; & Lt; DefaultValue & gt; True & lt; / DefaultValue & gt; & Lt; / Checkbox & gt; & Lt; Checkbox & gt; & Lt; ID & gt; UseShield & lt; / Id & gt; & Lt; Captions & gt; Use shield & lt; / Caption & gt; & Lt; DefaultValue & gt; False & lt; / DefaultValue & gt; & Lt; / Checkbox & gt; & Lt; Checkbox & gt; & Lt; ID & gt; UseSpell & lt; / Id & gt; & Lt; Captions & gt; Use spelling & lt; / Caption & gt; & Lt; DefaultValue & gt; False & lt; / DefaultValue & gt; & Lt; / Checkbox & gt; & Lt; / Root & gt;  

I have not worked with XSLT yet I have used kkow to make it different outputs like HTML

Is this possible?

Thank you!

But I'm not sure that I can also create server-side control as an output using XSLT template.


jquery jqgrid unformatter for SEARCH filter -


In my column this column is called Time, which is local time in yyyy-mm-dd hh: mm: ss Shows AM / PM format. This is done by the formatter function. It is stored in the UTC format in the database. So obviously I need a conversion back. It seems that the inefficient option does not work for search filters. Any idea to call my conversion function when killing the FIND button? Thanks a lot.

This is not an ideal solution, but you can do infrastructure on server-side. You can use Javascript to set the client's time zone for UTC back conversion. Here's an example of a quick search, if you decide to go down this route then there are probably other people:

< / Html>

php strtotime issues -


ठीक है, मैं यह समझता हूं:

  mm / dd / yyyy - 02/01 / 2003 - स्ट्रॉटाइम () रिटर्न: 1 फरवरी 2003 मिमी / डीडी / या - 02/01/03 - स्ट्रेटोटाइम () रिटर्न: 1 फरवरी 2003 yyyy / mm / dd - 2003/02/01 - स्ट्रॉटोम () रिटर्न: 1 फरवरी 2003 Dd-mm-yyyy - 01-02-2003 - strtotime () रिटर्न: 1 फरवरी 2003 yy-mm-dd - 03-02-01 - strtotime () रिटर्न: 1 फरवरी 2003 yyyy-mm-dd - 2003-02- 01 - स्ट्रॉटोमेम () रिटर्न: 1 फरवरी 2003  

तो मेरा सवाल है, उपयोगकर्ता की उम्र को स्वीकार करने के लिए आप स्ट्रिंग को कैसे html पृष्ठ पर सेट करते हैं?

मैं एक बॉक्स बना सकता था जो

महीने, दिन और वर्ष

या मैं इसे ऊपर विभाजित कर सकता

, लेकिन यह सच नहीं है कि Strtotime एक स्ट्रिंग की उम्मीद होगी, तो यह बात करता है।

अगर आप इसे कड़ाई से करने की कोशिश कर रहे हैं पीएचपी, वहाँ तरीकों से आप तिथियों को संसाधित कर सकते हैं ... अधिकांश के लिए मामलों, strtotime () काम करता है, लेकिन कोई अजीब प्रारूप दर्ज कर सकता है इस मामले में आपके इनपुट को 3 टेक्स्ट बॉक्स MM / DD / YYYY में अलग करने के लिए स्मार्ट हो सकता है, फिर एक $ _POST हैंडलर करें और वास्तव में एमकटाइम () () के साथ समय जनरेट करें।

अगर मुझे चुनना है , मैं निश्चित रूप से उपयोगकर्ता के अनुभव के लिए जावास्क्रिप्ट मार्ग पर जाना होगा यह उपयोगकर्ता के लिए फ़ॉर्मेट करने के लिए तिथि और लिखने के बजाय दो क्लिक्स में प्रारूप प्राप्त करना आसान बनाता है, और इससे आपके लिए थोड़ी कम कोडिंग की अनुमति मिलती है:

उदाहरण:

  & lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; $ (फ़ंक्शन () {$ ("# तारीख पिक्चर")। तारीखपिकर ();}); & Lt; / स्क्रिप्ट & gt; & Lt; div वर्ग = "डेमो" & gt; & Lt; p & gt; दिनांक: & lt; input type = "text" id = "datepicker" & gt; & lt; / p & gt; & Lt; / div & gt; & lt;! - अंतिम डेमो - & gt; & Lt; div वर्ग = "डेमो-विवरण" शैली = "प्रदर्शन: कोई नहीं;" & gt; & Lt; p & gt; तिथिपिकर एक मानक फ़ॉर्म इनपुट फ़ील्ड से बंधा हुआ है एक छोटे ओवरले में इंटरैक्टिव कैलेंडर खोलने के लिए इनपुट पर ध्यान दें (क्लिक करें या टैब कुंजी का उपयोग करें)। एक तिथि चुनें, पृष्ठ पर कहीं और क्लिक करें (इनपुट को धुंधला), या बंद करने के लिए Esc कुंजी को दबाएं। अगर कोई दिनांक चुना जाता है, तो फ़ीडबैक इनपुट के मूल्य के रूप में दिखाया जाता है। & Lt; / p & gt; & Lt; / div & gt; & lt;! - एंड डेमो-विवरण - & gt;  

PHP strtotime को संभालता है जो युग के बाद आपको सेकंड देगा। आप इसे अपने डेटाबेस (int) में संग्रहीत कर सकते हैं और फिर ('एफ डी, वाई', $ टाइम) का उपयोग कर सकते हैं; सेकंड से अपनी तिथि प्रदर्शित करने के लिए।


How do I parse JSON with Ruby on Rails? -


I'm looking for an easy way to parse JSON, want to extract a value and write it in a database in Rail I am

What I see especially, there is a way to remove shortUrl from JSON back to the bit.ly API:

  {" Errorcode ": 0," error message ":" "," result ": {" http://www.foo.com ": {" hash ":" e5TEd "," shortKeywordUrl ":" "," shortUrl ": "Http: //bit.ly/1a0p8G", "userHash": "1a0p8G"}}, "status code": "OK"}  

and then take that short URL and Write it in an active recorder object attached to long URL.

This is one of those things that can completely think through concept and when I sit then I know that I have to learn a lot.

These answers are a bit dated, so I'll give you:

  hash = JSON.parse string  < / Pre> 

Rail should automatically load the json module for you, so no should be to 'json' .


Android - Can an app developed in Android 1.6 run in Android 2.0? -


Android backwards is compatible, in other words, Android 2.0 can be developed in Android 1.6?

I just published 2.0 applications and I came to know that I can not get into the market using my G1 (Android 1.6) phone. But apparently others are downloading it.

Should I downgrade the application to 1.6 or I need to create separate applications for each android version?

Since you have developed your app with 1.6 SDK, you should (need?) It's 1.6 Flag with This will increase the number of person who will be able to view and download your app.

If they are identical, then 2 apps (1.6 and 2.0) are not required. If you want to try to develop your app using the new features of Android SDK 2.0:

  1. Update the old app if you only have Android 2.0 (or if you Make a new app on the market to target
  2. Android 2.0
.

c# - Copy Datagridview to clipboard in Windows Forms -


I want to copy selected columns to the DataGridView clipboard and paste them in Notepad or Microsoft Word. What is the best way to achieve this?

Thank you ..

I use a copy menu item. If you want to use Ctrl + C, you have to apply the keyboard event here. My code is:

  Private Zero copyToolStripMenuItem_Click (Object Sender, EventArgs e) {foreach (tabControl1.SelectedTab. Controls in control myControl) {if} {DataGridView tempdgv = (myControl is DataGridView) (DataGridView) myControl; DataObject dataObj = tempdgv.GetClipboardContent (); Try {Clipboard.SetDataObject (dataObj, true); } Hold (Exception Pre) {// Something} Finally {if (selectAllToolStripMenuItem.Checked) {selectAllToolStripMenuItem_Click (This, EventArgs.Empty); }}}}}  

architecture - MVC, where to generate ViewModel classes? -


जहां ViewModel creation होना चाहिए? सेवा स्तर में, नियंत्रक में?

  सार्वजनिक वर्ग ObjectA {सार्वजनिक स्ट्रिंग नाम {get; set;} सार्वजनिक IList & lt; ChildB & gt; बच्चे {प्राप्त; सेट;}} सार्वजनिक वर्ग ऑब्जेक्ट एवियमोडेल {सार्वजनिक ऑब्जेक्ट ए ऑब्जेक्ट ए {प्राप्त करें; सेट;} सार्वजनिक आईएलआईआईएसटी & lt; ChildB & gt; SelectableChildren {get; set}}}  

क्या होगा यदि ObjectA पर कुछ गुणों को रनटाइम पर गणना करना है?

  सार्वजनिक वर्ग ObjectA {सार्वजनिक स्ट्रिंग नाम { प्राप्त; सेट;} सार्वजनिक IList & lt; ChildB & gt; बच्चे {get; set;} सार्वजनिक गणित विधि {get; set;} सार्वजनिक दशमलव की गणना {}; सेट;}}  

कहता है कि ObjectA.CalculatedValue है रिपॉजिटरी में सभी या कुछ ChildB ऑब्जेक्ट्स से गणना की गई है (न केवल संबंधित ऑब्जेक्ट्स), और यह कि CalculateMethod मान के आधार पर अलग-अलग गणना की जाती है? क्या मुझे ObjectA का विस्तार करना चाहिए, और उस स्थिति में, मुझे इसे कहाँ रखा जाना चाहिए? एक साथ ऑब्जेक्ट ए या एक डीटीओ कहीं और के रूप में? और जहां गणना की जानी चाहिए?

यह एक गैर तुच्छ का सवाल है। विचार के लिए एक प्रारंभिक बिंदु है और वहां से अन्य चर्चाओं के संदर्भ हैं।

मैं जावा पृष्ठभूमि से हूं और इसलिए आपके पास दुनिया का प्रत्यक्ष अनुभव नहीं है, लेकिन एक वैचारिक स्तर पर मेरी सोच जाती है: / P>

मॉडल विचारों के बारे में कुछ नहीं जानते हैं, वे सिर्फ डेटा उपलब्ध करते हैं और उपलब्ध सत्यापन नियम भी बना सकते हैं कि विचारों को उपयोगी हो सकता है उदाहरण के लिए: यहां कुछ तारीख है, यह फ़ील्ड "विभाग" फ़ील्ड है। यहां सभी मान्य विभागों की एक सूची है, एक मॉडल के रूप में मैं आपको कुछ नहीं जानता हूं, लेकिन आप अनुमान लगा सकते हैं कि आप विभागों की सूची से एक ड्रॉप-डाउन सूची को पॉप्युलेट कर सकते हैं।

उस समस्या के साथ मॉडल बहुत मात्रा में डेटा भेज सकता है, जिसके बारे में विचार की कोई परवाह नहीं है, पर पढ़ें ...

नियंत्रक विचारों और मॉडलों की वास्तविक सामग्री के बारे में कुछ भी नहीं जानते हैं, लेकिन वे जानते हैं कि कुछ निश्चित मॉडल में रुचि रखते हैं इसलिए उनके पास ज़िम्मेदार होने का ज़िम्मेदारी है कि वे डेटा की जरूरत पाना चाहते हैं। नियंत्रक एक डेटिंग एजेंसी की तरह है, परिचय बना रहा है, लेकिन फिर से कदम उठा रहा है।

इसलिए सबसे सामान्य परिदृश्य में देखें तो खुद को एक मॉडल दिया जाता है और डेटा की आवश्यकता होती है जो इसे ज़रूरत होती है। तो दृश्य मॉडल के बारे में जानता है, लेकिन इसके विपरीत नहीं। अब एक आरोपण विवरण के रूप में हम उस रिश्ते को एक व्यूमोडेल वर्ग से बाहर खींच सकते हैं, इस दृश्य के लिए दिलचस्प आंकड़ों को पकड़ सकते हैं और हम एक दृश्यमॉडेलफैक्टालर क्लास के तर्क को भी निकाल सकते हैं। नियंत्रक वास्तव में देखने के आधार पर उचित ViewModelFactory को चुनने की जिम्मेदारी रख सकता है, और इसलिए कुछ अर्थ में नियंत्रक "व्यू मॉोडेल" बना रहा है, लेकिन तर्क (वैचारिक) दृश्य की ज़िम्मेदारी है।


rss - Yahoo Pipes says source page is too long -


I want to use Yahoo pipe to extract part of webpage and convert it to RSS. The problem is Pipes says that the page is too long, which is disappointing, because it seems I can not do anything about it.

Is there a way to solve this problem within Pipes? If not, the only way I can think of is getting a web service similar to pipes that can remove a part of a page and use its output as input for the pipe. Are there. Do you know this kind of service?

On this page from Google, you can shorten webpages to browse with mobile phones:

This greatly reduces the size of the page, so it helps you.


C# Comparing two files and exporting matching lines based on delimiter -


Here's the scenario.

I have a text file (alpha), one column, of items with a bunch.

My second file is a CSV (Delta) that has 4 columns I

I have to compare the delta with alpha and create a new file (omega) in which the alpha delta , It will export only the first two columns from Delta to a new .txt file.

Example: (alpha) BeginID / P> P> This document may contain 10k lines. Thanks for the help!

Here's a rough cut method:

  System Use; Using System.Collections.Generic; Using System.IO; Using System.Text; Namespace ConsoleApplication1 {class program {static void key (string [] args) {String alphaFilePath = @ "C: \ Documents and Settings \ Jason \ My Documents \ Visual Studio 2008 \ Projects \ Compte Two Files \ Compte Two Files \ ExternalFiles \ Alpha .text "; & Lt; String & gt; Alpha content = new list & lt; String & gt; (); Using (FileStream FS = New FileStream (alphaFilePath, FileMode.Open)) (StreamReader RDR = New StreamReader (FS)) {while (rdr.EndOfStream!) {AlphaFileContent.Add (rdr.ReadLine ()) ; }} String betaFilePath = @ "C: \ beta.csv"; Stringbilder sb = new stringbiller (); Using (FileStream FS = New FileStream (BetaFilePath, FileMode.Open)) (StreamReader RDR = New StreamReader (FS)) {While (! Rdr.EndOfStream) {string [] betaFileLine = rdr.ReadLine () . Split (replace. Tochar (",")); If (alphaFileContent.Contains (betaFileLine [0]) {sb.AppendLine (String.Format ("{0}, {1}", betaFileLine [0], betaFileLine [1]); }}} (Using the file stream FS = new filestream (@ "c: \ omega.ttec", fliemmode.creative)) (stream writer author = new streamer (FS)) {writer.Write (sb) .toString ()); } Console. WrightLine (SBthostring ()); }}}  

Actually it reads a txt file, puts content in a list, then it reads a CSV file (no column considers) and values ​​to create a stringbilder Corresponds to In your code, replace the stringbilder with the creation of a new txt file.

EDIT: If you wish to run the code in a button click, then click on it button to call the handler (or a new routine):

  Public Zero Button Clicks (Object Sender, EventArgs E) {string alphaFilePath = @ "C: \ Documents and Settings \ Jason My Documents \ Visual Studio 2008 \ Projects \ Compte Two Files \ Compat two files \ ExternalFiles \ Alpha.txt"; & Lt; String & gt; Alpha content = new list & lt; String & gt; (); Using (FileStream FS = New FileStream (alphaFilePath, FileMode.Open)) (StreamReader RDR = New StreamReader (FS)) {while (rdr.EndOfStream!) {AlphaFileContent.Add (rdr.ReadLine ()) ; }} String betaFilePath = @ "C: \ beta.csv"; Stringbilder sb = new stringbiller (); Using (FileStream FS = New FileStream (BetaFilePath, FileMode.Open)) (StreamReader RDR = New StreamReader (FS)) {While (! Rdr.EndOfStream) {string [] betaFileLine = rdr.ReadLine () . Split (replace. Tochar (",")); If (alphafile content. (BetaPileline [0]) {sb.AppendLine (string.format ("{0}, {1}", betafileline [0], betafileline [1]);}}} Using the file stream FS = new filestream (@ "c: \ omega.ttec", fliemmode.creative)) (stream writer author = new streamer (FS)) {writer.Write (sb.ToString ())}}  

delphi - FastMM, stack trace memory for leaks in dynamicly loaded DLL, compiled with runtime packages -


I am using FastMM with JCL debug information to detect memory leaks in my application. Although I have DLL compiled plugins in Deluxe, both DLS and main applications use the normal runtime package. Now, when I close the application, this text generates a memory leak report in the file which is fine, but there is a stack mark in it for only for the main app . If there is a memory leak in the plugin DLL, then the stack trace leads to the loading plugins; Process in the main application! Of course my plugins are JCL debug data (this is inserted in the Dell Binaries.)

Where's the problem? Is Runtime Package Reasonable To Use? Or some switch (defined) which I forgot to enable / disable? Thank you in advance

Did you set the FooledbugMod option and Memory Manager sharing option (ShareM M and the following) Is FastMM4Options.inc? Have you compiled even with debug infos?


post - resume uploads using HTTP? -


Is it possible to resume interrupted uploads using HTTP post? I'm working on a project that uploads many files to an HTTP server thanks.

Believing that you have control over both the client and server side of this project at a much lesser level This can be obtained through content-range headers in your post (or PUT) requests that send data.


Run php scripts from within phpMyAdmin -


Is it possible to run phpMyAdmin from external php scripts (located inside the root folder of my web server)? The reason for this is that I have some chart scripts that I would like to perform from within phpMyAdmin.

Thank you.

I do not think this is possible. But what you can do is just book those scripts or save them in the database and click them from there (within phpMyAdmin).


ruby on rails - Has_many/belongs_to association not saving due to polymorphic associations? -


I am trying to create a log of attributes that have changed in every update of a certain message. Features are issuer and type continue , and both of these have two topical associations with the updated action , which is changed_from_id Changed_to_id and changed_to_type completely

  class issuer status  with  changed_prom_type  ActiveRecord :: Base is - Medium: update_actions ,: as in => : Changed_to has_many: update_actions ,: as = & gt; : Type the end class from the changed class and type & lt; ActiveRecord :: Base is - Medium: update_actions ,: as in => : Changed_to has_many: update_actions ,: as = & gt; : Changing End Class Updates & lt; ActiveRecord :: Base is has_many: update_action and class update action & lt; ActiveRecord :: Base is_to: change_to ,: polymorphic = & gt; The truth is included: changed, from: polymorphic = & gt; It is true that trying to save  updateAction  to  update.update_actions  is not working. Guardrail  true  both  save  and  save! , but my development.log is not being used to query any SQL queries. I do not know what I am doing, because nothing is logged (or I do not know how to find it). Working from console: 

  & gt; & Gt; Verb = updateAction.new = & gt; # & Lt; Update Action ID: Zero, changed_frame_guide: zero, changed_prom_type: zero, changed_to_id: void, changed_type_guide: zero, update_id: zero, created_at: zero, updated: zero & gt; & Gt; & Gt; Action.changed_from = to = & gt; # More lieutenant; Issuchatus ID: 2, Name: "Open", created_at: "2009-12-02 05:34:41", updated_at: "2009-12-02 05:34:41" & gt; & Gt; & Gt; Action.changed_to = to = & gt; # More lieutenant; Issustatus ID: 1, Name: "closed", created_at: "2009-12-02 05:34:30", updated_A "2009-12-02 05:34:30" & gt; & Gt; & Gt; Action.save = & gt; True & gt; & Gt; Update = update. Last = & gt; # & Lt; Update ID: 1, Description: "Yawn", created_t: "2009-12-02 05:19:25", updated_it: "2009-12-02 05:19:25" & gt; & Gt; & Gt; U.update_actions & lt; & Lt; Action = & gt; [# & Lt; UpdateAction id: 2, changed_from_id: 2, changed_from_type: "IssueStatus", changed_to_id: 1, changed_type: "issustatus", update_id: 1, created_at: "2009-12-02 05:35:16", updated_at: "2009- 12-02 05:35:16 "& gt;]] & gt; & Gt; U.save = & gt; True & gt; & Gt; U.update_actions = & gt; [# & Lt; UpdateAction id: 2, changed_from_id: 2, changed_from_type: "IssueStatus", changed_to_id: 1, changed_type: "issustatus", update_id: 1, created_at: "2009-12-02 05:35:16", updated_at: "2009- 12-02 05:35:16 "& gt;]] & gt; & Gt; U.reload = & gt; # & Lt; Update ID: 1, Description: "Yawn", created_t: "2009-12-02 05:19:25", updated_it: "2009-12-02 05:19:25" & gt; & Gt; & Gt; U.update_actions = & gt; []  

Any help would be greatly appreciated, I think I am doing something wrong, but I am too late to know what happened. thank you in advanced!

"post-text" itemprop = "text">

your first line

  action = UpdateAction.new  

For example

  action = Update.last.update_actions.build  

Here's what's happening in you (assuming you reference a real U Giving, is not updated as Swanand) - The U.Sweo line is not doing anything because it only saves unsaved related objects that you have already saved an incomplete action, Therefore related Bjekt no work saves has_many that do not seem to do it, because you need to change the region is related objects. Therefore, the update_id field of action is not being saved. You can also call action.save and fix it.

I will have update_presence_of update_id to prevent and prevent FB blocking in DB on update_actions for update_id.


Server socket programming in Android 1.5, most power efficient way? -


I am doing a project where I also develop an application that listens for incoming events from a service There is also an Android phone with Android SDK 1.5 on that device. At present, services that make event calls apply only the communication trough UDP or TCP sockets. I can solve my problem by setting up a server socket, but I suspect that this is the most power efficient way. This app will be running on Wi-Fi for most of the time, and I also want to reach a longer battery life. I was looking for alternatives on the internet for a while for my question but I did not get a real answer. I have the following questions:

  • What is the most effective way of coming events? Should I Make a ServerSet? Or what are my options?
  • Is there any other implementation that is more powerful?
  • I was also thinking about implementing communication communication XMPP is not sure that this is the best way I have not been forced even a specific implementation. All suggestions are welcome!

    Thanks for the help,

    Entek

Possible options are listed if the app has to be able to handle events, then it must be run all the time. Afaik does not have a push-notification service that automatically calls your application, such as on the iPhone.

I think using XMPP protocol is the easiest solution to use. Being with your server server will also mean that whenever you are switching to your network, the server will have to send a request for various IPSs.


flex3 - Flex tab navigator: initialize hidden tabs -


The problem is that if I do not open a tab, then it is not started and therefore there are no existing forms in it.

How can I create it like the user clicked on every tab

Set "all" to creationPolicy

& lt; Mx: TabNavigator creationPolicy = "all" & gt; & Lt; -! Children - & gt; & Lt; / Mx: TabNavigator & gt;

Python SOAP client library using a HTTPS connection with keys -


I want to query a SOAP service for which the use of keys is required.

I can write a soap that the client is using HTTPSConnection of Sublevel itself, I'm pretty sure this will work, but that means I have to write the XML load. Is there a good way to do this? Probably getting an existing SOAP library to use an HTTPSConnection object.

Since 2001, I found an old version of SOAPpy (not SOAPY), but I think the SOAPpy library has changed since then.

see url about the argument HTTPS < / Code>:

url - The method is called to call URL.

This claim

From a twisted developer's perspective, there is little difference between XML-RPC support and SOAP support.

After the example there should be no difficulty in calling SOAP HTTPS . Note that turns is different from other python networking frameworks, and there is an important learning curve in it.

PKI HTTPS Support, it looks like there are some limitations, hopefully twisted API will meet your needs.


asp.net - Visual Studio is not recognizing new classes -


I am using Visual Studio 2008 SP1, I am working with a web project in VB.NET. Problems When I add a new class file (of Course in App_Code), it does not recognize it. All old class files are working fine, but new ones are not. I restarted my computer and still the same problem.

Any ideas

Compare the properties Workers with a non-recognized category In particular the class, "build action" should solve this problem.

If I did not tell :)


java - How to properly roll back to an older version in CVS HEAD using Eclipse? -


I have a CVS repository in which I have a set of eclipse java projects where I want to roll back the state to the head Need was a special time yesterday, which was essentially the time since the time of abandoning all acts.

I have tried different things, including using "Replace with another branch or version", which gives proper source, but where it appears, CVS now thinks that I Actually I'm working in "back time" rather than head, but with other sources, which displays the files transferred to the team synchronize etc Along with this, it tells me that I am working on sticky tags and fails.

So, what is the correct way to say Eelpse 3.5.1 that I need a filth rollback for tomorrow?

I usually use the following for different files:

 Replace with  - & gt; History  

Which can be found under the right click menu

You want to select the version (Includes locally saved versions included in it) < / P>

Then commit to making it head


Loading images and adding to Stage in Actionscript 3 -


I want to load an image object and want to add it to the stage in order. How do I complete this?

If this is an external image then you will use it:

  Var loader: loader = new loader (); Loader.load (new URLRequest ("http: //urltoyourimage.jpg")); Loader.contentLoaderInfo.addEventListener (Event.Complete, On CompoundHandler); Function On Complexhandler (Event: Event): Zero {event.target.removeEventListener (event.complete, on complexhelder); AddChild (event.target.content); }  

javascript - What is the easiest way to link radiobuttons to enable/disable other controls? -


मेरे वेबपेज में विभिन्न रेडियोबूटन समूहों के एक गुच्छा भर में रेडियोबूटन्स का एक गुच्छा है। प्रत्येक रेडियॉबटन चयन, जो पृष्ठ में सीधे संबंधित तत्व को सक्षम करेगा और सभी अन्य तत्वों को अक्षम कर देगा जो समूह के अन्य रेडियोबूटों के अनुरूप हैं। तत्वों के बीच इस लिंक को बनाने का सबसे आसान तरीका क्या है?

विशेषता 'अक्षम' जोड़कर जावास्क्रिप्ट-फ्रेमवर्क का उपयोग करने के लिए jQuery। उदाहरण के लिए:

  $ ('# targetElement')। Attr ('disabled', 'disabled');  

इसके अलावा आपको यह भी ध्यान में रखना चाहिए कि अभिभावक तत्व के लिए क्वेरी करना और इसे बाल तत्वों को अक्षम करना आसान है।

इसके अलावा, दस्तावेज़ लोड होने के लिए इंतजार करना अच्छा है और फिर रेडियो नियंत्रण पर क्लिक-हँडलर्स जोड़ें


oracle - Materialized View fast refresh taking a long time -


I have a large desk that is Oracle 10.2.0.4 and using MView replication on the network from Oracle 9i database Repeated. The master table is about 50 GB, about 160 M lines and there are approximately 2 - 3m new or updated rows per day.

A physical visual log has been created using the roaded in the master table.

Refresh the visual works completely and take approximately 5 hours, which we can live with.

However, it is struggling to keep refreshing fast. To refresh the Oracle, two questions are required against malog and master tables, first it looks like:

  SELECT / * + / DISTINCT "A1". "M_ROW $$" FROM "JENVA_ADMIN" "MOLG $ _BILLSUMMARY" "A1" Where "A1" "M_ORO $$" & lt; & Gt; Select all ("A2". "BINSUME_ADMIN". "BILLSUMMARY" "A2" WHERE "A2" .ROWID = "A1". "M_ROW $$") and "A1" "SNAPTIME $$" & gt; : 1 and "A1". "DMLTYPE $$" & lt; & Gt; 'I'  

The current plan is:

  --------------------- - ----------------------------------------- | ID | Operation | Name | -------------------------------------------------- ------------- | 0 | Select Command | | | 1 | Hash unique | | | 2 | Filter | | | 3 | Table access by INDEX ROWID. MLOG $ _BILLSUMMARY | | 4 | Index Range Scan | MLOG $ _BILLSUMMARY_AK1 | | 5 | User Access to table access by ROID.  

When 3M rows are changed, then this query really goes on forever - it's basically useless though, if I write it a little bit and the master table and I ask for the full scan of the malog table, then it is completed in 20 minutes.

The problem is that the above questions are coming out from the beginning of Oracle and I. It can not change the problem is actually a filter operation on line 2 - if I include it in both tables and hashes / anti-join I am sure that I can get it to be done quickly, but I will not get any receipt of signals, to stop the use of the filter operator. Rei - Maybe it's not even legitimate. I can use gestures to make it full scan of both the tables, but the filter operation remains, and I think it is 5 for each row for row 3 Performs, which will have 2-3m rows.

Thanks, <,

/ P>

Stefan As you've written that questions are part of an internal Oracle system, your tuning options are limited as

The fastest algorithm starts behaving differently in more recent versions, check it out.

You can also see in the (10G feature) package with permission to tune you to individual SQL statements.


svn update - Why do I have to routinely Clean one particular project in Eclipse? -


I am using Eclipse 3.5 for many different Java / JSP projects. All our project codes are stored in subversion. I use the subclipse plugin to update code / update This is a project that works very well for all projects except one, almost every time I update an SVN, the whole project is full of Java compilation errors She goes. Most errors are such complaints that no other category files can be found in the same project. To solve this, I need to clean the project> clean and project manually, which takes a little while to run. Everything is compiled right after that, but every time I update the SVN, it is a bit of pain to manually clean the project manually. And this happens only for one project.

Does anyone feel like this? I do not even know why it is necessary to manually clean the project, it is possible to understand where it is possible that someone is checking in any other file that breaks the construction of my project in eclipse? If so, what files should I see? First of all, I'm sorry if I say something is clear, but you have a description of your project configuration. Have not given up, nor have you described your previous efforts to solve this problem. So, maybe you have already tried to do everything ... ...) ->

From the top of my mind, I will check that someone is compiling classes rather than other sources or no only.

In addition, it depends on your configuration: I'm assuming that the "Automatically created" flag has been checked, that you are only building through Eclipse ( And not, for example, through the ant, the ant can be constructed somewhere in your class), and that you are not making a jar nor your classpath file.

I suggest (if you are not doing this) to update your SVN running synchronized view (synchronize with team -> repository), when there is a problem with your project Then, to distinguish matters better, you do not have to look at the kind of changes that are coming.


c# - Repeating the Header of a DataList -


मैं एक asp: DataList का उपयोग कर रहा हूं। मेरे पास हैडरटैम्प्लेट और ItemTemplate है, और ये दोनों ठीक काम करते हैं हालांकि, मैं शीर्ष पर केवल एक बार की बजाय प्रत्येक आइटम के ऊपर हैडर को दोहराने में सक्षम होना चाहता हूं।

  1. क्या यह संभव है? क्या मैं एक अलग नियंत्रण का उपयोग करना बेहतर होगा?
  2. क्या मैं इस विन्यास (यानी इसे पीछे कोड में बंद किया जा सकता है) बना सकता हूं?

(सी # 2.0 का उपयोग करना)

शायद आप नियंत्रण की तलाश कर रहे हैं।


css - Center Dropdown Divs, Move Following Divs Down With Bootstrap -


I am starting with bootstrap and running in two problems. First of all, I am trying to focus my hero-start-form Div. I have tried "center-block", "inline-block", "margin: 0 auto" width and many other things that have not worked, I currently have it ("position: absolute" and "below: 0 "was to be inserted into the lower part of the zambotron. -row-start-form div):

  .hero-start-form {status: complete; Bottom: 0; Correct: 0; }. Vertical-start-form Selection-Container {Padding: 0; Status: Relative; }  

Secondly, I'm showing the bootstrap carousel code placed below the jambotron at the top of the jambotran division instead of below.

I tried to do this carousel:

  # myCarousel {display: block; Status: Relative; }  

What am I missing?

Here are my JS Friedal:


c# - Cannot work out how a property accessor is called by using the keyword "this" -


Thank you in advance I am quite new to coding so please be patient. Below is a piece of code on which I am working. This is the complete code below it is as follows:

  using the system; Public class product {name of private string; Private decimal value; Public string name {get {return name; } Set {name = value; }} Public decimal value {received {return value; } Set {value = value; }} Public product (string name, decimal value) {this.name = name; this. Value = value; }}  

In the page load method, an object is immediately assigned and the constructor is said to be as follows:

  Private zero page_load (object sender, EventArgs e) {Product Sale Product = New Product ("Kitchen Garbage", 49.99 M); }  

When the product is created, the constructor is started with the above values. Now if you look in the constructor, then you have:

  this.name = name;  

and

  this.price = value;  

After executing the above two lines of code, property accessors automatically provide private variables ("name" and "value") with prices.

How are the lines:

  this.name = name;  

and

  this.price = value;  

Able to call public accessers named "name" and "price"?

I have only seen when a public accessor is explicitly called like:

  sales product. Name = "kitchen trash";  

I do not understand how:

  this.name = name;  

and

  this.price = value;  

I can directly reach a personal variable I thought the whole thing about property accessories was that you will have to go through the property name to use the private variables:

  saleProduct.Name = "kitchen trash";  

Can you help and explain it?

  this.name = name;  

and

  this.price = value;  

Able to reach public properties? Even the name of the property i.e. "name" and "value" is changed to "kitchen trash" and "49.99" respectively, when the above two lines of code are executed.

In addition, how to

  this.name = name;  

and

  this.price = value;  

Know what public caller is to call?

Thank you.

"text">

private member names and Values ​​are available in all non-static methods within the class product . Since for the product the constructor is part of the class, the members can also be there.

Your constructor is not using public properties names and value . They get their values ​​from the respective private members.


Matrix representation of categories in R -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 4 जवाब

मेरे पास एक कॉलम है श्रेणियों का सेट जैसे श्रेणी 1, श्रेणी 2, श्रेणी 3, श्रेणी 2 आदि। निम्नलिखित दृश्य के साथ एक मैट्रिक्स के रूप में उन्हें आर में प्रतिनिधित्व करने का कोई तरीका है:

  श्रेणी 1 श्रेणी 2 श्रेणी 3 1 0 0 0 1 0 0 0 1 0 0 1 0 ... ... ...  

कोई भी प्रतिक्रिया बहुत सराहना की जाती है।

मैं निम्न कार्य करेगा:

  मैट्रिक्सफ़ॉर्म & lt; - फ़ंक्शन (एक्स) {मान & lt; - सॉर्ट (अनन्य (एक्स)) outM & lt; - मैट्रिक्स (0 , (एन = 1 मूल्यों [आई]) colnames (outm) के रूप में (i 1: ncol (outm)) outM [, i] & lt; - as.numeric के लिए nrow = लंबाई (एक्स), ncol = लंबाई (मान)) & Lt; - मान वापस (outM)}  

एक्स अक्षरों का एक इनपुट वेक्टर है। तो परिणाम ...

  X & lt; -c ('श्रेणी 1', 'श्रेणी 2', 'श्रेणी 2', 'श्रेणी 3', 'श्रेणी 1', 'श्रेणी 3') मैट्रिक्सफॉर्म (एक्स) ################ श्रेणी 1 श्रेणी 2 श्रेणी 3 [1,] 1 0 0 [2,] 0 1 0 [3,] 0 1 0 [4,] 0 0 1 [5 ,] 1 0 0 [6,] 0 0 1  

vim - How to enable a plugin manager without ~/.vimrc -


After using VIM for some time, my ~ / .vim / With the beginning Vim started experimenting with it and got messed up over time. So I thought, it would be time to clean up and start with the plugin manager with a clean configuration.

As I share my configuration on several machines, I usually use my ~ / .vim / path with a GIT repo a bigger. To avoid Vimrc, I have kept my own configuration under ~ / .vim / plugin / . This allows me to keep all my shared configuration in this folder and only use ~ / .vimrc for machine dependent configuration.

Starting with VAM on NeoBundle and now Vundle I always have the same problem if I ~ / .vimrc instead of ~ / .vim / plugin / pluginmanager.vim , the installed plugins are not loaded or only partially loaded. The command : echo and rpt lists the correct bundles, but plugins installed in : script name are not included if I mv ~ / .vim / plugin / Pluginmanager.vim ~ / .vimrc execute then everything works as expected.

Can anyone explain this behavior and possibly provide a solution?

My pluginmanager.vim looks like this:

  set character must be set to "iMproved, close the required file type" expected " Set Runtime Path to include the Wand Start RTP + = ~ / .vim / bundle / Vundle.vim Call Wandal # Start () "Manage Vandal Vandal, Required Plugin", gmarik / vundle.vim 'plugin' bling / Vim- Airline 'plugin' MarcWeber / vim-addon-Mw-utils 'plugin' TomTom / Tibba_wim 'plugin' Clothing / Vime-Snippet 'plugin' hone All your plugins should be added before "All / Line Snippets" "All following line call call vandle # end ()" required file type plugin indent "required  

My Vime Installation Version 7.4 .52 is

The problem is in the startup order. Your ~ / .vimrc is executed after the (as the first thing during startup), Vim runs something like : runtime! / * To load plugins Vim as soon as your plugin manager applies only, changes to 'runrintip' that triggering : runtime does not reach the command yet, and load plugins Fail in

There are several functions:

  • Move your script to ~ / .vim / pluginmanager.vim and explicitly : Runtime pluginmanager.vim (each copy) from your ~ / .vimrc .
  • Re-triggered by : runtime! Plugin / *. Vim .

But I agree with Bratenomies that the best solution would be to use ~ / .vimrc , and instead keep system-specific configuration in a different script.


Indentation and wrapping XML document with XSLT -


मैं एक एकल XSLT स्टाइलशीट डॉक्टर का उपयोग करके विभिन्न XML दस्तावेज़ों को प्रारूपित करना चाहता हूं। मैं XSLT के साथ निम्नलिखित कैसे कर सकता हूँ:

  1. 3 अंतरिक्ष वर्णों का इंडेंटेशन?
  2. 100 वर्णों के बाद रैपिंग लाइन?

सेटिंग्स पूर्व-परिभाषित टोकन या नोड के लिए विशिष्ट नहीं हैं, लेकिन पूरे एक्सएमएल

XSLT विशेष रूप से या तो संरचना या दस्तावेजों की सामग्री को बदलने के लिए उपयोग किया जाता है। ज्यादातर मामलों में, एक्सएमएल दस्तावेजों में तत्वों का खरोज स्पष्ट रूप से कॉस्मेटिकल है, चूंकि केवल रिक्त स्थान-केवल पाठ नोड आमतौर पर महत्वपूर्ण नहीं हैं। ऐसा कहा गया है कि, किसी भी XML दस्तावेज़, एक पहचान को बदलना जो & lt; xsl: output indent = "yes" /> निर्दिष्ट करता है, ठीक से इंडेंट करने के लिए एक प्रभावी तरीका है। फिर भी, इंडेंटेशन वर्णों की संख्या XSLT प्रोसेसर के कार्यान्वयन पर निर्भर करती है जो आप उपयोग कर रहे हैं।

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; xsl: ट्रांसफ़ॉर्म xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" संस्करण = "2.0" & gt; & Lt; xsl: आउटपुट पद्धति = "xml" एन्कोडिंग = "यूटीएफ -8" इंडेंट = "हां" / & gt; & Lt; xsl: टेम्पलेट मैच = "@ * | नोड ()" & gt; & LT; XSL: प्रतिलिपि & gt; & Lt; xsl: लागू-टेम्पलेट चुनें = "@ * | नोड ()" / & gt; & Lt; / XSL: प्रतिलिपि & gt; & Lt; / XSL: टेम्पलेट & gt; & Lt; / XSL: परिणत & gt;  

जो

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "UTF-8"? & Gt; & LT; बॉडी & gt; & lt; h1 & gt; & lt; / h1 & gt; & lt; / body & gt;  

से

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "UTF-8"? & Gt; & LT; बॉडी & gt; & Lt; h1 / & gt; & Lt; / body & gt;  

आप एक ऐसे दस्तावेज़ का निर्माण कर सकते हैं जो कुछ निश्चित वर्णों के बाद पाठ लपेटता है, लेकिन यह आमतौर पर एक्सएसएलटी के साथ नहीं किया जाता है। XSLT डेटा को रूपांतरित करता है, इसका अर्थ रेंडरिंग एजेंट के रूप में नहीं किया जाता है। रेखा की चादर कुछ ऐसा होता है जिसे एक उपकरण के भीतर लागू किया जाना चाहिए जो डेटा को प्रदर्शित करता है, जैसे कोई संपादक। कई संपादकों के पास लाइन रैप ऑप्शन है, उदाहरण के लिए दस्तावेज़ को वर्तमान विंडो आकार में फिट करने के लिए।

अतः, यदि रिक्त स्थान और लाइन रैप की एक निश्चित राशि से इंडेंटेशन केवल परिवर्तन हैं तो आप किसी दस्तावेज़ को बनाना चाहते हैं, XSLT का उपयोग न करें पूर्व असंभव है, बाद में वह अतर्कसंगत नहीं है - सिवाय इसके कि ऐसा करने का अच्छा कारण है।


ios - UIView width & height not adjusting to constraints -


This is a question about IOS, XCode, Auto Layout and Objective-C, I think this is an easy answer, But I have searched high and low and can not get the solution.

I have a small Crosr having images as users pan around the map like in a Google Maps image is frozen I just Google map view a GMSMapView which I Having done an IBOutlet, self.mapView is doing this by adding a UIImageView as a subview.

I image the calculation of space with:

  crosshairs.center = CGPointMake (self.mapView.bounds.size.width / 2, self.mapView.bounds .size.height / 2);  

In the meantime, I have set barriers on the map's view so that its leading and trailing spaces can be evaluated for supervision. It should make breadth and height liquid - or so I thought.

In fact, when I width of the map view at runtime and height Anselog, they width (600) and height (384) as specified in the shape inspector in Xcode -. Even if I have not pinned with width or height barriers

The result is that the image is not centered for the screen, but to the wrong width and height of the map view (which is the screen )

I know that I'm looking at some idiots, or I do not remember the concepts of auto-layout. Anyhow, I appreciate any guidance.

Will

Important When using automatic layout, do you have to manually The frame should not be changed again (using the setCenter: in your code) you should take everything from the obstacles.

You can add UIImage to the storyboard at the top of the map and limit it there, using constraints.

If this is not possible, then you can add constraints in code using something like this:

  [self.mapView addSubview: crosshairs]; [Crosshair set traceletsautorerisingingsmusent consultants: no]; [Self.mapView addConstraints: [NSLayoutConstraint constraintWithItem: self.mapView Feature: NSLayoutAttributeCenterY Related: NSLayoutRelationEqual toItem: crosshairs attribute: NSLayoutAttributeCenterY Multiplier: 1.0 continuous: 0]]; [Self.mapView addConstraints: [NSLayoutConstraint constraintWithItem: self.mapView feature: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: crosshairs featuring: NSLayoutAttributeCenterX multiplier: 1.0 constant: 0]];  

Depending on where these constraints are being added, you may have to call [self.mapView layoutIfNeeded];. Using a deficiency of

, the map should always be centered on the top of the map view.

Regarding the wrong frame for the map view, it depends on whether you are entering it. If your IBOutlet in a UIViewController , then in viewWillLayoutSubviews should: after [Super viewWillLayoutSubviews]; Pu

- (zero) VisualVilueLatSub view {{Super View attributes attributes}; NSLog (@ "Map View Frame% @", NSSSingFromCegrate (SELFMapviewFrame)); }

If you put it in a custom UIView category, then you should check the frame in the layout: SUBviews:

  - (zero) layout previews {[Super layout slides]; NSLog (@ "Map View Frame% @", NSSSingFromCegrate (SELFMapviewFrame)); }  

Hope this fixes your problem.


javascript - How to add selected attribute to ng-repeated dropdown form? -


I have a form that creates multiple widgets based on some JSN data. There is a select dropdown in the part of that form, and some items have different options by default.

i.e.:

  object 1 {tag: "products"}  

select dropdown in ng-repeating widget < / P>

  & lt; Select class = "btn-success form-control" & gt; & Lt; Option value = "companies" & gt; Companies & lt; / Options & gt; & Lt; Option value = "news" & gt; News & lt; / Options & gt; & Lt; Option value = "People" & gt; People & lt; / Options & gt; & Lt; Option value = "product" & gt; Product & lt; / Options & gt; & Lt; / Select & gt;  

^ If this was object 1 , then I would need alternatives to get the product to get the selected attribute.

What I have tried so far has not worked, but you can see my thinking:

HTML

  Ng-repeat = "stuff in things" ... ... & lt; Select class = "btn-success form-control" & gt; & Lt; Option value = "companies" & gt; Companies & lt; / Options & gt; & Lt; Option ng-if = "widget.selectedTag (stuff.tag)" value = "news" & gt; News & lt; / Options & gt; & Lt; Option value = "People" & gt; People & lt; / Options & gt; & Lt; Option value = "product" & gt; Product & lt; / Options & gt; & Lt; / Select & gt;  

Controller

  this.selectedTag = function (s) {console.log (s); If (s = 'news') {return 'selected'; }}  

How can you go about this?

Answer here:

  & lt; Option ng-selected = "{{operator.value == filterCondition.operator}}" ng-repeat = "operator in operator" value = "{{operator.}}" & Gt;  

Then in my case:

  & lt; Option value = "product" ng-selected = "{{stuff.tag == 'products'}}" & gt; Products & lt; / Options & gt;  

Does the logback.xml appender element support nested appender-ref element? -


I only configure Perf4j on an app that uses logback for logging. When I tried to set up AsyncCoalescingStatisticsAppender , I nested the Appendar-Rif element, which links to other fileforms.

But there was no message in the reference appended.

When I was trying to debug it, I found out that there was no downstream appender at all!

Then I changed the Appendar-Rif element with a complete appendix announcement and the downstream adapter was set.

I have changed this code

  & lt; Epander name = "colacicististics" class = "org.perf4j.logback.AsyncCoalescingStatisticsAppender" & gt; & Lt; Param name = "timeslice" value = "10000" /> & Lt; Epander-Riff Ref = "Filler" /> & Lt; / Appender & gt;  

with this:

  & lt; Epander name = "colacicististics" class = "org.perf4j.logback .AsyncCoalescingStatisticsAppender" & gt; & Lt; Param name = "timeslice" value = "10000" /> & Lt; Appender Name = "Filler" class = "ch.qos.logback.core.FileAppender" & gt; & Lt; File & gt; $ {Logs.location} /perfStats.log</file> & Lt; Attached & gt; True & lt; / Enclosed & gt; & Lt; Encoder & gt; & Lt; Pattern & gt;% msg% n & lt; / Pattern & gt; & Lt; / Encoder & gt; & Lt; / Appender & gt; & Lt; / Appender & gt;  

What logback. XML element element nested aper-rif elements?


c# - How to register and resolve multiple components based on same service -


I have a cached repository that implements the same interface as the real repository. Ie

  public class CachedLocationRepository: ILocationRepository public square LocationRepository: ILocationRepository  

I how both registered do with Autofac and a certain Tell which service to use?

That is, some components are used in real use, using some cached versions

  public class UseRealImpl:. IUseRealImpl {public UseRealImpl (ILocationRepository locationRepository) {}} public class UseCachedImpl: IUseCachedImpl {public UseCachedImpl (ILocationRepository cachedLocationRepository) {}}  

you can use the critters serve to:

for example:

  Kantenrbilder builder = new Kantenrbilder (); Builder.RegisterType & lt; CachedLocationRepository & gt; () As & lt; ILocationRepository & gt; () .Keyed & LT; ILocationRepository & gt; (RepositoryType.Cached); Builder. Registration Type & lt; Location repository & gt; (). Like & lt; ILocationRepository & gt; () .kid & lt; ILocationRepository & gt; (Repository type, real);  

Then can register UseCachedImpl using a parameter:

  builder.RegisterType & LT; UseCachedImpl & gt; () As & lt; UseCachedImpl & gt; () .WithParameter ((pi, c) = & gt; pi.ParameterType == typeof (ILocationRepository), (pi, c) = & gt; c.ResolveKeyed & LT; ILocationRepository & gt; (RepositoryType.Cached));  

or WithKeyAttribute

  public class UseCachedImpl {public UseCachedImpl ([WithKey (RepositoryType.Cached)] ILocationRepository cachedLocationRepository) {} }  

or a module which will automatically add the parameter to the condition of a situation, for example if the service applies some interfaces.


java - Matching Keys in a HashMap -


  • HashMapOne will generate:

    I try to do after (in psuedocode) The result was a DICOM file (the key was for manipulating purposes for matching purposes).

  • Generate a second HashMapTwo that will be read from a text document.
  • Compare the keys to both HashMaps if matching matches the value of HashMapOne in a new HashMapThree.

I'm stuck with HashMapThree to add the value of the matching key. It always populates a redundant value even after declaring a public stable variable. Can anyone tell me why this could happen? Below are the code snippets given below:

  Public class viewDocumentTags {Hashmap < String, string & gt; DicomFile = New Hashmap & lt; String, string & gt; (); HashMap & LT; String, string & gt; DikomTaglist = New Hashmop & lt; String, string & gt; (); HashMap & LT; String, string & gt; Results = New Hashmop & lt; String, string & gt; (); Iterator & LT; Org.dcm4che2.data.DicomElement & gt; Iter = null; DCOM object is working; Public stable DicomElement element; Give the diochem element element two; Public stable string result; File digamlist = new file ("C: \\ user \\ ryan \\ dicomTagList.txt"); Public Zero reads DICOMObject (string path) throws IOException {DicomInputStream din = null; Days = new dynamic inputstream (new file (path)); Try {work = din.readDicomObject (); IARR = Working While (iter.hasNext ()) {element = iter.next (); Result = element.toString (); String s = element.toString () Substring (0, Math.man (element.toString (). Length (), 11)); DicomFile.put (String.valueOf (s.toString ()), element.vr (). ToString ()); } System.out.println ("stored tag, VR code, and descriptions from DICOM file ...."); } Hold (IOException e) {e.printStackTrace (); Return; } Finally {try {din.close ()}} Hold (ignoring IOException) {}} readFromTextFile (); } Public Zero read FremTextFile () throws IOException {try {string dicomData = "DICOM"; String line = null; Buffarder bReader = new buffed reader (new flamerdider (decomlist)); While ((line = bredder. Readline ())! = Null {dicomTagList.put (line.toString (), dicomData);} System.out.println ("Reading tag from text file ...."); bReader. Close ();} Hold (FileNotFoundException e) {System.err.print (e);} Hold (IOException i) {System.err.print (i);} Compare DICOMSets ();} Public Zero compareDICOMSets () throws For IOException {enter  string> entry: dicomFile.entrySet ()} {if (dicomTagList.containsKey (entry.getKey ())) Result.put (entry.getKey (), dicomFile Get (element.toString ()); Println (dicomFile.get (element.toString ());} Sorted set & lt; string & gt; keys = new TreeSet & lt; string & g (String key: keys) {string value = result. Gate (key); println (key);}}}  

This line of code looks very wrong

  result. Enter (entry .getKey (), dicomFile .get (element.toString ()));  

The main / value pairs from HashMapOne are trying to copy, so this is not correct.

The value for each key will be nulled for the result, because you are calling the on method on the interface on the decompile. find requires a key as a lookup value, and you enter

  element.toString ()  

Where the element is the last element that has been read from your file.

I think

  should be using Result.put (entry.getKey (), entry.getValue ()););  

javascript - PHP create file out of POST, then force user to download it - not working -


I have a page with some form and input field, which fills the user and then they are sent to a php page Ajax And $ _POST and then the php file writes the output to a txt file. - It works fine. My problem is that I am forcing the user to download the same page that creates the file, after the file has been created and I do not seem to be working it, the file There is nothing except:

  $ myfile = fopen ("test.txt", "w") or die ("unable to open file"!); Forex Currency ($ url ARR and $ url) {$ line = $ some [$ key [$ index]]. "\ T". $ Something else [$ well [$ Index]]. "\ T". $ Some alar [$ .. key [$ index]] "\ t" $ SomeArray [$ key [$ index]] "\ t" $ url "\ n" .. .Filit ($ myfile, $ zeile); $ index = $ index + 1;} Fclose ($ myfile);  

And here's the code, where I'm forced to download I try: (after fclose)

  header ('content type: application / octet-section'); header ('content-dispute: attachment; filename ='. Basename ('test .txt ')); Header (' Termination: 0 '); Header (' Cash-Control: Required-Modified '); Header (' Pragm Public '); header (' Content-Length: ". Filesypes ('test.txt')); Readfile ('test.txt'); Go out;  

And when I try this I get an error: "Unexpected Tokens A" "A" is the first letter in test.txt which has been created.

And I know there are so many similar questions, but one solution does not work for me.

I hope someone can help me :)

this backend Instead of doing it with PHP, you can try doing this on the frontend part. The easiest solution is to write some javascript code that adds iFrame to your webpage. Iframe should be an href of the file you want to download the user.


python - Pandas DataFrame Float Formatting -


I have a panda dataframe of survey responses, which I am collecting the average score and output to HTML . My current code looks like this:

  Import as import pandas np df = pd.read_csv ('survey_scores.csv', header = 0) np.round (pd.DataFrame ( Df) Overall ('mean') score) .transpose (), 2) .to_html ()  

It takes a dataframe that looks a bit like this in the CDS ...

  response_number, question_number, score1, 1, 3.0 1, 2, 4.0, 3, 4.0 2, 1, 4.0 2, 2, 4.0 2, 3, 1.0  / Pre> 

and it excludes average digits in an HTML table that formats such a score value:

  3.5, 4, 2.5  

ha However, I am trying to get the output to force each digit to display two digits after the decimal point. I found it to be rounded to two decimal digits, but I have difficulty getting my output to format such values:

  3.50, 4.00, 2.50 < / Code> 

How do I format these values ​​in two decimal places?

I have solved the problem. I Pandas.DataFrame.to_html () can format the float.

Import as pd import NP DF = pd.read_csv ('survey_scores.csv', header = 0) as np.round (pd) pandas altogether ('mean'). Score). Management (), 2) .to_html (float_format = lambda x: '% .2f'% x)


coldfusion - Is it possible to disable a cfinput type=text field using a conditional cfscript if statement? -


I have a dynamically populated text field with cfform If user comes to the user form on the form, then the database is empty, I would like to "enable" the field so that they can fill in the information and submit the form. However, if they have already done this and have a database population, then I would like to "disable" the fields.

Basically, I want to:

  & lt; Cfscript & gt; If (define "query.column")} {cfinput fields} disable  

Is it possible? If not, any ideas about how to accomplish this?

This is what I mean by my comment, I do not believe you have cfscript There is a reason for what to do within the tag. You are already using tag syntax for your form, when you are creating a form, just check your status (s). For example, now you have something like this:

  & lt; Html & gt; & Lt; Top & gt; & Lt ;! - Here are some codes - & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;! - Here are some codes - & gt; & Lt; Cfform ... & gt; & Lt; Cfinput type = "text" ... & gt; & Lt; / Cfform & gt; & Lt ;! - Here are some codes - & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

The suggestion I am giving is something to do:

  & lt; Html & gt; & Lt; Top & gt; & Lt ;! - Here are some codes - & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;! - Here are some codes - & gt; & Lt; Cfform ... & gt; & Lt; Cfif isDefined ("query.column") & gt; & Lt; Cfinput type = "article" disabled = "disabled" ... & gt; & Lt; Cfelse & gt; & Lt; Cfinput type = "text" enabled = "enabled" ... & gt; & Lt; / Cfif> & Lt; / Cfform & gt; & Lt ;! - Here are some codes - & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Use similar conditions in tags, as you form a form for any other field or button etc.


windows - What does copy/paste actually do? Where is the copied information stored? - VBA -


I'm just wondering what's happening when you do something like this

  Range ("Test").  

Is any Windows that stores such information "global" copy / paste space? How can you reach it?

Copies of boundaries specified in the clipboard

You can easily verify it by duplicate a single text (an email, web browser, Excel spreadsheet, etc.) and then paste it into your second document. Are there.

You can access the clipboard from MSForms.DataObject class:

  as Dim DataObj Object Set up MSForms.DataObject Dim S As String DataObj = CreateObject ("MSForms.DataObject") DataObj.GetFromClipboard S = DataObj.GetText debug.print S  

work with Chip Pearson's site There are some other examples to do, manipulate, etc., with the clipboard.


Zend Framework 2 - Deploy proeject to web server -


I'm trying to take your ZF2 Project web server I have created the following copy from your local computer: / config , / data, / module, / public, / Know and init_autoloader.php Apache Virtual host / try public folder to point to the setup when I run the application I, the browser will return an error

Fatal Error: Unknown error 'Zend \ Loader \ Exception \ InvalidArgumentException' message Areas with 'Autoloader class Zend \ Loader \ StandardAutoloader Zend \ Loader \ /var/www/vhosts/.../vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php:91 stack SplAutoloader' trace: # 0 /var/www/vhosts/.../vendor/zendframework /zendframework/library/Zend/ModuleManager/Listener/AutoloaderListener.php(34): Zend \ loader \ AutoloaderFactory :: factory (array) # 1 [internal function]: Zend \ ModuleManager \ Listener \ AutoloaderListener -> __ invoke (object (Zend \ ModuleManager \ ModuleEvent)) # 2 / var / www / vhosts/.../vendor/zendframework/zendframework/ library/Zend/EventManager/EventManager.php ( 468): call_user_func (object (Zend \ ModuleManager \ listener \ AutoloaderListener), object (Zend \ ModuleManager \ ModuleEvent)) /var/www/vhosts/.../ in /var/www/vhosts/.../ # 3 Vendor / zendframework / zen dframework / library / Zend / EventManag Seller / zendframework / zendframework / library / Zend / Loader / AutoloaderFactory.php line 91

Any suggestions? Thank you.

"itemprop =" text ">

This error is due to the old PHP version on your server. 5.3.3 Not enough You should be aware of the limitations:

  2.3.0 requires php> = 5.3.23 2.4.0 php> = 5.3.23  < / Pre> 

You can use Z Framework 2.2.10 at php5.3.3. Edit your code application / composer.json

  "need": {"php": "> = 5.3.3", "zendframework / zendframework "Edit:" ~ 2.2 "}  

Then run php composer.phar install , it will restore your structure:

 < Code> & gt; Installing the Composer Store Loading dependencies with information of php composer fire installation package (including required-Dev) - Removing zendframework / zendframework (2.4.0) - Installing zendframework / zendframework (2.2.10) Downloading: Prepare 100% write lock file autoload files  

r - Obtaining results from operations on multiple files as a two-column matrix -


I am using a loop for loop through files in a directory. Then I make a set of processing data on each file and write a matrix with 10 rows. This is my code. (1 in I: length (testdata)) {MAE [1, i] = abs (predict data $ [i] - testData [i])}

  / code>  

Now I want to do the following:

  • Add rows to this matrix
  • Write it as a value
  • File name Two columns matrix with different columns and the value in the form of the second column
  • Sort it by value (no file name)
  • Access it globally (i.e., this For matrix The number of rows will be the total number of files in the directory (dynamically specified what i mean). How can I get this functionality?

    It is difficult to give a comprehensive answer because there is no instance in general, however, I use the list.files () vector of all the files To get, and then write that function Is not that satisfy you have mathematics on each file. This function may look something like this.

      func.file_math & lt; - function (file.name) {& lt; Insert file operation & gt; Return (You can run it on all content by using the list (file.name = file.name, number = number))}  

    sapply () Your file.list () . Once done, you can simply use the do.call () and rbind.data.frame to get the data frame of the results.

      Your files & lt; - list.files ("/ some / path /") file_math & lt; - sapply (X = yourfiles, FUN = func.file_math, simplify = FALSE, USE.NAMES = TRUE) file_math.df & lt; - Please .Call (What is = RBIDDETEframe, args = file_math)