Thursday, 15 May 2014

c++ - Difference in size between std::vector and std::deque -


मैं एक vector & lt; int & gt; और डेक & lt; int & gt; / Code> अगर मैं उन दोनों पर sizeof प्रिंट करता हूं, तो std :: vector में 12 बाइट्स हैं (मुझे लगता है कि शुरू, अंत और आकार लगता है) जबकि डेक < / कोड> 40 बाइट्स हैं उन अतिरिक्त बाइट कहां से आते हैं?

मैं Code :: Blocks IDE 13.12 का उपयोग कर रहा हूं और मैंने C ++ 11 मानक का चयन किया है इस्तेमाल किया जा सकता है। "post-text" itemprop = "text">

sizeof ऑपरेटर का आकार लेता है <

यदि किसी ऑब्जेक्ट के तीन डेटा सदस्य चर हैं, तो sizeof ऑपरेटर उन सदस्य चर का आकार प्राप्त करेगा, लेकिन अगर उनमें से एक अधिक डेटा के लिए एक संकेतक है, तो आपको केवल सूचक का आकार मिलता है, न कि डेटा की लंबाई को इंगित करता है।


asp.net - Implement jQuery Plugin in Visual Studio 2013 Project -


मैंने Visual Studio 2013 में एक नया asp.NET वेब प्रोजेक्ट प्रोजेक्ट बनाया है। यह डिफ़ॉल्ट रूप से स्थापित jquery-1.10.2.js ।

मैंने पैकेज मैनेजर कंसोल का प्रयोग- पैकेज jQuery -Version 1.11.2 में किया क्योंकि प्रबंधन नुगेट संकुल केवल डिफ़ॉल्ट रूप से Nuget 2.1.3 की पेशकश की थी। मुझे पहले jQuery की आवश्यकता है।

मैं वीएस 2010 का उपयोग कर रहा हूं, और मैं पूरी तरह से नए एएसपी.नेट 4.5 स्क्रिप्ट मैनेजर से परिचित नहीं हूं। JQuery के प्लगइन्स के लिए वीएस 2010 के साथ, आप मास्टर पेज के मुख्य भाग में .js और .css को संदर्भित करते हैं।

  & lt; head id = "head1" runat = "server" & gt; & Lt; link href = "css / colorpicker.css" rel = "स्टाइलशीट" प्रकार = "टेक्स्ट / सीएसएस" / & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" src = "जेएस / रंग पिक्चर.जेएस" & gt; & lt; / स्क्रिप्ट & gt; & Lt; / head & gt; एएसपी .नेट 4.5 के साथ मैं एक तीसरी पार्टी के jQuery प्लगइन को जोड़ने के तरीके के बारे में थोड़ा सा अस्पष्ट हूँ, क्योंकि ऐसा प्रतीत होता है कि सभी .js फ़ाइलों को ScriptManager के द्वारा कार्यान्वित किया जाता है, न कि बस सिर अनुभाग में स्क्रिप्ट टैग के भीतर संदर्भित।  

मेरा Google अनुसंधान: "दृश्य स्टूडियो 2013 वेब फॉर्म में jquery प्लगइन स्थापित करें" में इनके साथ काम करने वाले मुद्दे मिलते हैं: Nuget पैकेज प्रबंधक, JQuery स्थापित करना, या विज़ुअल स्टूडियो एक्सटेंशन।

मुझे कुछ भी नहीं मिला है जो स्पष्ट रूप से बताता है कि विजुअल स्टूडियो 2013 के साथ एएसपी.नेट वेब प्रपत्र अनुप्रयोग में तीसरे पक्ष के jQuery प्लगइन्स को कैसे जोड़ना है।

यहां मेरे जेएस संदर्भ हैं वीएस 2013 में नव निर्मित मास्टर पेज:

  & asp: ScriptManager runat = "server" & gt; & LT; स्क्रिप्ट & gt; & Lt;% - स्क्रिप्ट मैनेजर में बंडलिंग स्क्रिप्ट के बारे में अधिक जानने के लिए http://go.microsoft.com/fwlink/?LinkID=301884 -% & gt; & Lt;% - फ्रेमवर्क स्क्रिप्ट -% & gt; & Lt; asp: ScriptReference name = "MsAjaxBundle" / & gt; & Lt; asp: ScriptReference नाम = "jquery" / & gt; & Lt; asp: ScriptReference name = "bootstrap" / & gt; & Lt; asp: ScriptReference name = "response" / & gt; & Lt; asp: ScriptReference नाम = "WebForms.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / WebForms.js" / & gt; & Lt; asp: ScriptReference नाम = "WebUIValidation.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / WebUIValidation.js" / & gt; & Lt; asp: ScriptReference नाम = "MenuStandards.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / MenuStandards.js" / & gt; & Lt; asp: ScriptReference नाम = "GridView.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / GridView.js" / & gt; & Lt; asp: ScriptReference नाम = "DetailsView.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / DetailsView.js" / & gt; & Lt; asp: ScriptReference नाम = "TreeView.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / TreeView.js" / & gt; & Lt; asp: ScriptReference नाम = "WebParts.js" विधानसभा = "System.Web" पथ = "~ / लिपियों / WebForms / WebParts.js" / & gt; & Lt; asp: ScriptReference name = "Focus.js" विधानसभा = "System.Web" पथ = "~ / स्क्रिप्ट / वेबफॉर्म / फोकस.जेएस" / & gt; & Lt; asp: ScriptReference name = "WebFormsBundle" / & gt; & Lt;% - साइट लिपियों -% & gt; & Lt; / स्क्रिप्ट & gt; & Lt; / एएसपी: ScriptManager & gt;  

यह नया वी.एस. 2013 वेब प्रपत्र प्रोजेक्ट में भी है: packages.config, संदर्भ। Js, बंडल कॉन्फ़िग.कॉम

मैं आपके मार्गदर्शन की सराहना करता हूं।

मैं आमतौर पर / App_Start फ़ोल्डर में BundleConfig.cs के अंतर्गत अपने स्वयं के बंडल में कस्टम स्क्रिप्ट को निम्न प्रकार से जोड़ता हूं:

  ScriptManager.ScriptResourceMapping.AddDefinition ("my-plugin", नया ScriptResourceDefinition {path = "~ / scripts / my-plugin.min.js", डीबगपाथ = "~ / लिपियों / my-plugin.js" ,});  

तब आप अपने मास्टर पेज में स्क्रिप्ट मैनेजर में बंडल को संदर्भित कर सकते हैं (जैसे कि jQuery ScriptReference) इस तरह से:

  & lt; asp: ScriptReference name = "मेरा-प्लगइन" / & gt;  

यह आपको डिबगिंग बनाम उत्पादन के लिए अलग .js फ़ाइलों का उपयोग करने की अनुमति देता है। अगर आपके पास केवल एक स्क्रिप्ट संस्करण है, तो मेरा विश्वास है कि आप बस डीबगपथ लाइन को छोड़ सकते हैं।

यदि प्लग-इन को किसी भी सीएसएस फ़ाइलों को जोड़ने की आवश्यकता है, तो उन्हें Bundle.config में निम्न प्रकार से जोड़ा जा सकता है:

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; बंडल संस्करण = "1.0" & gt; & Lt; शैली बंडल पथ = "~ / सामग्री / सीएसएस" & gt; & Lt;! - ... अन्य फाइलें संभवतः यहां शामिल हैं - & gt; & Lt; पथ में शामिल करें = "~ / content / my-plugin.css" / & gt; & Lt; / styleBundle & gt; & Lt; / बंडलों & gt;  

c# - Create X tables by looping with HtmlGenericControl -


I'm trying to create 10 separate tables, but I end up with only one.

  HtmlGenericControl table = new HtmlGenericControl ("table"); For (Int i = 1; I <5; i ++) {table.ID = "Serie_table_" + i; Table. a quality. Add ("Square", "Serie_Table"); DivSerie_lists.Controls.Add (table); }  

I want the following result:

   

But I end up with:

  & lt; Table id = "serie_table_4" class = "serie_table" />  

I hope you can help me though - and make tables correctly.

You change the same object 4 times instead you need to create 4 different objects:

 for  (int i = 1; i  

In addition to this, you can use HtmlGenericControl instead.


rest - Spring MVC @RestController and redirect -


I have a final endpoint with Spring MVC @RestController. At some time, depending on the input parameters of my controller, I need to send an HTTP redirect to the customer. I

Is it possible with Spring MVC @Rist controller and if so, can you show an example?


Can I use .net core on visual studio 2013 -


, or will it be available for use on Core Core Visual Studio 2013? Or will it be available on Visual Studio 2015?

Thanks

Yes, this creates a portable class library by creating .NET Core 5 contracts It is possible to build against, which targets the .NET Framework 4.5 and Windows 8. You will need to manually edit the .csproj file and add the following.

  & lt; Asset group & gt; & Lt; ImplicitlyExpandTargetFramework & gt; False & lt; / ImplicitlyExpandTargetFramework & gt; & Lt; / PropertyGroup & gt;  

Then install the NuGet package and other .NET Core 5 packages.

As a result the assembly will be able to execute on any .NET Core 5-based framework. Net Framework 4.6, ASP.NET 5 & amp; .NET Native resident

Note, this is the same technique used to create .NET Core Assemblies in the repository.


shell - Crontab, scheduled jobs, on holidays -


I wrote a shell script to monitor the rest of the API, when it is below, then Shell Script has two mails for the developer The second problem for the manager is that I need this frequency with this frequency:

  • During work hours every 9 minutes (9-18 hours) during work Runs and sends mail to manager and developer

  • On weekdays, between 6-9 pm and 18 to 24h Sends mail to manager issues and sends.

  • Send mail every 3 00:00 to 6:00 per night and hours of holidays and manager

¿ How can I stop the holidays and work days?

You will need several entries:

  1. every 15 minutes during office hours

    * / 15 09-18 * * * yourscript.sh

  2. Send email to manager only, if inside the script Add someone who will check the time and send it to the manager only

    00 06-09,18-23 * * * yourcript.sh

  3. Each three Send To Hours

    00 003,0 * * * yourcript.sh

To run on the holidays, Crohn will not be able to help you, a You will need to get a file from the source looking, which lists all the holidays and then adds to your script

  #! / Bin / sh if [grep -q` date +% f` /random_location/holidays.txt]; Then after leaving the 0 to # continue your script here  

javascript - How to HTML5-drag an element that has a link in it -


I have an element inside which there is a link and I want to be able to pull it out. The element looks like this:

  & lt; Div draggable = "true" & gt; & Lt; A href = "#" & gt; 122/1 & lt; / A & gt; & Lt; / Div & gt;  

Dragging itself works fine, meaning that all possible events are removed. However, when the user clicks on the link to drag, the element will not pull. In Safari and Chrome, I see a gray box with rounded corners in which there is a text and href link, so it seems that I am just dragging the link and not the element. See this Bela :. While clicking on the link to drag, div still ignores its dragstart event, but it is not dragged.

How can I make the version with the link properly displayed while dragging?


java - Putting 2 jpanels in borderlayout -


I'm trying to add 2 zpn to the border. It is such that, a japnil-shaped pen will be of 1 (600,600) and the second one will have a pen 2 (200,600). I'm hoping to pack them that a large number will be on the left side and the other one is correct. I'm setting the shape of each JPIN, but it seems that both of them overlap the entire space and kind on each other

I am a complete newbie here and I do not know what is going wrong. Any help is appreciated Jeffrey Frame = New Jeffrey ("Simple Graph"); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Frame.setLayout (new border layout ()); Int pane1_width = FRAME_WIDTH-200; // 800-200 pen 1 myPlots = new pen 1 (graph_panel_size, frames_HEIGHT);
frame.ed (MyPlay); Pane2 simpleInfo = new pen2 (200, frame_height); Frame.add (simpleInfo); Frame.pack (); Frame.setSize (FRAME_WIDTH, FRAME_HEIGHT); Frame.setResizable (wrong); Frame.SsetVisible (true);

This is a base frame class for

public page 2 (integer width, integer height) {/ this.setSize (width, height) ; Border blackline = borderfacture Siquette titledirector ("Ola"); This.setBorder (Blackline);

The other panel has a similar constructor but both genpelles overlap each other and I can not keep them separately

The problem is that you are calling setSize () . When using the setSize / setBounds / setLocation , it is completely useless when using LayoutManager '(which you should always have)).

Additionnaly, calling SetPreferredSize () / setMinimumSize / setMaximumSize is not recommended and may be reversed.

Either a good reason for the size given to your component (because you're doing custom painting, for example), then you should override the getPreferredSize Or you just do not need to do anything, and use only the appropriate layout manager .

You can also

.BorderLayout; Import java.awt.color; Import java.awt.Dimension; Import java.awt.Graphics; Import javax.swing.JFrame; Import javax.swing.JPanel; Import javax.swing.SwingUtilities; Public Class TestCustomPainting {Private Static Category MyTriangle JPanel {Private Finals provides width width; Private Final In Height; Public MyTriangle (integer width, integer height) {this.width = width; This.height = Height; } @ Override Get Public Dimensions First Size () {Return New Dimension (Width, Height); } @ Override Protected Zero Paint Comonant (Graphics G) {SuperPaintConant (G); G.setColor (Color.GREEN); Gifolgazine (new int [] {0, gatewidth (),}, new int [] {0, 0 (hot) ()}, 3); }} Protected static zero initUI () {JFrame frame = new JFrame ("test"); Frame.add (new MyTriangle (200, 45), border layout. EAST); Frame.ed (new mittrigengle (85, 600), border layout. West); Frame.pack (); Frame.setVisible (true); } Public static zero main (string [] args) {SwingUtilities.invokeLater (New Runnabal) {@Override Public run zero () {initUI ();}}); }}

NB: I have to accept, the colors are more interesting: -)


c# - Do I have to remove the handler -


The more I push in the C # and the GC, I find more things, I'm not sure about this I always thought Dispos and related finals are only necessary when there are some unmanaged resources in my class.

But I have many opportunities where there are only native C # classes where this is not quite clear to me. I need disposal and related final additives. For example, when the event handler is attached to my event .

Do I need to remove event-handlers when I call them on a bus? Besides, I was told that if the event handler is still connected then the objects will not be collected. If this is the case then GC is compromised in some way.

Is it possible that when and how do I need to execute and apply lastly?

Actually I have more questions about this, but perhaps the answer to this question can help me further. Dealt with and finalize:

If you have any The area that is one (or some other kind of unmanaged resource, but IntPtr is the most common) and this is the responsibility of your classes that you need to implement in order to clear that resource. . In that final, you should also remove any resources from IntPtr points. If you do not have any interpreter, then the class you are holding should be finalized and it will be applicable to IDisposeable (see the next section)

If you have The field is applied to your class and your class is responsible for cleaning after that object, your class should also implement IDisposable and you should resolve that method which you Dispose () should call the object.

For event handlers, this is a matter of personal choice. You can, but it is important only if you do or not.

Unless you expect the publisher of this program to exit the customer, there is no reason to remove the event handler ...

I am not personally, but I know some people who do, if you want to do this, then the process is setting the event handler to null in your settlement method only.

  Public Sealed Class Example: IDisposable {public event handler MyAvent; Remove public null () {MyEvent = null; Edit}: And a good point is that: You do not have  required  in the final form, if you have an unmanaged resource For which it will need to be finalized. Wrap the wrapper to handle the final form for you. Once you do this, the object becomes just another normal  IDisposable , then you will get your < Code> has to be kept in mind. Wizard ()  method 


d3.js - dagreD3 - Are Renderer and DiGraph objects deprecated? How to do Transitions and Layouts? -


I see many Dagre-D3 code samples that start like this:

  var g = new dagreD3.Digraph (); Var Renderer = New dagreD3. Renderer (); Var layout = dagre.layout ();  

But I can not create these 3 objects, I get the javascript "no function" error instead. I am linking to the "latest" dagreD3 library at:

  & lt; Script src = "http://d3js.org/d3.v3.min.js" charset = "utf-8" & gt; & Lt; / Script & gt; & Lt; Script src = "http://cpettitt.github.io/project/dagre-d3/latest/dagre-d3.js" & gt; & Lt; / Script & gt;  

I can get a work graph instead of these objects and codes, which I am getting in other examples:

  var g = new dagreD3 .graphlib.Graph (); Var Inner = D 3.select ("g"); Var render = new dagreD3.render (); // Create renderer render (internal, g); // run the renderer  

So my assumption is that the Digraphs and Renderer objects are "old" and disliked, is this correct? If not, why can not I create a renderer and digraph object? If I have renderer and digraph object really obsolete, then how do I get the changes and / or changes mentioned in this thread and use the sample code found here:

/ P> < Pre> // custom transition function function transition (selection) {return selection. Transcision () Period (500); } Renderer. Transition;

All I really want to do is remove a node and / or edge from a graph and it is "infected" in the new layout. I would think that something like:

  g.transition (). RemoveNode (d); G.transition () removeEdge (v).  

The best I can do is this:

  g.removeNode (d); G.removeEdge (v); Render (inner, live);  

Which "jumps" on the new layout rather than the transition easily. I'm new to D3 and still learning - What am I missing? Thanks for your help.

You can see your answer here:

  GIFFraph () . Transition = function (selection) {return selection. Transcision () Period (500); };  

and used here:


flash - Passing width & height into swf url -


मुझे ब्राउज़र में सीधे swf url से खेलना होगा यहां मेरा कोड है

  http://website.com/flash.swf?url=http://myaudio.mps/;&autoplay=true& त्वचा = test.xml और चौड़ाई = 400 और ऊंचाई = 100  

सही ढंग से ऑडियो प्ले, समस्या का सामना करना पड़ रहा है कि मैं चौड़ाई और ऊंचाई पर एसडीएफ के लिए पास नहीं कर सकता यूआरएल।

मदद करो


uialertcontroller - Get handler of UIAlertAction in Swift -


How is it possible to get the handler of UIAlertAction in SWIFT? It is set to begin, but I have not got any property to hold on to the closure of the operation. The closing type is (UIAlertAction) -> Zero However, I would like to get the contents of the closing so that I have some closures like () - & gt; Zero . Is this possible? Thank you for your reply

There is no member / asset to appear by UILart Action Class. Although we can manage it manually by sub-clinging UILArtation and some members can name it, say, "ActionHandler" to store it.


abap - How to convert SAP Table Raw Data (Data Type : LRAW) in Java -


I can read SAP table DBTiblogged data in Java application using SAP JCO

In this table, raw data (Data type: LRAW) is one of the columns, it is impossible to understand the content.

How can we convert this raw data into a readable format in Java? Any ideas would be welcome.

using javax.xml.bind.DatatypeConverter.printHexBinary similar situation Worked for me in

In addition, we can also convert the byte to a readable string to use the Java string constructor.

String readable String (bytes)

or

Experiment with character encoding

String Readable String (Bytes, "UTF-16")


ruby - List all cache items in remote servers with Dalli -


I am recently learning to learn more with Memcached and how Dully plays with various caching strategies. I am trying to remotely connect with our memcachier on Hiroko with one of my production level projects, through some tutorials, I came to know how to connect far away from Remote Remote Commanders.

sandbox.rb:

  requires 'dalli' memcachier_server = 'host_name: port' memcachier_user = 'abc123' memcachier_password = '1x8w3asdf82jdf' cache = Dalli :: Client.new (memcachier_server, {: username = & gt; memcachier_user ,: password = & gt; memcachier_password ,: failover => true ,: socket_timeout = & Gt; 1.5 ,: socket_failure_delay = & gt; 0.2}) c cache Stat  

I have confirmed this when I run Ruby sandbox.rb and the output arrives Is: [2015 -03-17T 101: 45: 20.703729 # 42640] INFORMATION: - Certifying Dalli / SASL as ABC 123 [2015-03- 17T01: 45: 21.305454 # 42640] Info -: Dalli / SASL: ABC 123 {"XYM .com: 11211" => {"Curr_items" =>
"24446", "Bytes" = & "0," "cas_hits" = & gt; "0", "cas_misses" = & gt; "0", "cas_badval" = "110738688", "evictions" = & gt; "2586065", "Timeout" => "0", "limit_maxbytes" => "120586239", "total_items" = & gt; "3782835", "Bytes_bread" = & gt; "1559184266", "Bytes_written" = & gt; "33808073647", "curr_connections" = & gt; "5", "Total_connection" = & gt; "1098", "auth_cmds" = & gt; "1098", "auth_errors" = & gt; "0", "cmd_get" = & gt; "19371543", "cmd_set" = & gt; "3782835", "cmd_delete" = & gt; "15829", "cmd_touch" => "0", "cmd_flush" => "0", "get_hits" => "16476147", "get_misses" = "0," "incr_mitses" = & gt; "0," "delete_hits" = & gt; "4131", "delete_misses" = & gt; "11698", "incr_hits" => "0", "incr_misses" = & gt; "0", "decr_hits" = & gt; "0", "decr_misses" = & gt; "0", "touch_hits" => "0", "touch_misses" = & gt; "0", "time" = & gt; "1426527920"}}

I am trying to figure out how to lose more in cached keys and values. To be more specific: I want to at least list all the keys and values ​​in the memcached using Deli currently. I can not find the right solution I found The best match is that helps you get it locally.

Any thoughts?


python 2.7 - Word Labels for Document Matrix in Gensim -


मेरा अंतिम लक्ष्य प्रत्येक दस्तावेज़ के लिए लेबल बाइनरी शब्द वैक्टर वाले * .csv फ़ाइल का निर्माण करना है । संक्षेप में, एक शब्द दस्तावेज़ मैट्रिक्स

जीन्सिम का उपयोग करके, मैं एक अनिलैब्लेड शब्द मैट्रिक्स के साथ एक फ़ाइल बना सकता हूं।

मैं इसे अनिवार्य रूप से कॉपी और पेस्ट करके यहां से करता हूं:

एक सूची को देखते हुए "ग्रंथों" नामक दस्तावेजों की।

  corpus = [text.doc2bow (text) ग्रंथों में पाठ के लिए] प्रिंट (कॉर्पस) [(0, 1), (1, 1), (2 , 1)] [(0, 1), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1)] [(2, 1), (5 , 1), (7, 1), (8, 1)] [(1, 1), (5, 2), (8, 1)] [(3, 1), (6, 1), (7 , 1)] [(9, 1)] [(9, 1), (10, 1)] [(9, 1), (10, 1), (11, 1)] [(4, 1) (10, 1), (11, 1)]  

उपरोक्त वैक्टर को एक नाभिकीय मैट्रिक्स में परिवर्तित करने के लिए, मैं इसका उपयोग करता हूं:

  scipy_csc_matrix = gensim मैटिटील्स। कॉरपस 2 सीसीसी (कॉरपस)  

मैं फिर स्पेर्स न्न मैट्रिक्स को पूर्ण सरणी में कनवर्ट करता हूं:

  पूर्ण_मैट्रिक्स = सीएससी_मैट्रिक्स (scipy_csc_matrix) .toarray () < / Code> 

अंत में, मैं इसे एक फ़ाइल में आउटपुट करता हूँ:

  खोलने के साथ ('file.csv', 'wb') f: writer = csv.writer (एफ) लेखक। लेखक (पूर्ण_मैट्रिक्स)  

यह एक पैदा करता है द्विपद वैक्टर के मैट्रिक्स, लेकिन मुझे नहीं पता कि कौन सा शब्द वेक्टर का प्रतिनिधित्व करता है। क्या वैक्टर को मिलान करने वाले शब्द का कोई सही तरीका है?

मैंने डिक्शनरी को उन शब्दों की एक रचनात्मक सूची में पार्स करने का प्रयास किया है, जो कि मैं उपरोक्त पूर्ण_मैट्रिक्स पर गोंद करूँगा। शब्दकोश हिन्दी शब्दकोश हिन्दी शब्दकोश हिन्दी शब्दकोश शब्दकोश से चाबियाँ और कुंजी के लिए full_matrix करने के लिए, मान tokenIDs.iteritems में (): temp1 = unicodedata.normalize ('एनएफकेडी', कुंजी) )। एन्कोड ('एएससीआई', 'अनदेखा') temp = [temp1] dictlist.append (temp) कीज़ = एनपी। सर्राय (dictlist) #Combine कुंजी और मैट्रिक्स labeled_full_matrix = np.concatenate ((कुंजी, पूर्ण_मैट्रिक्स), अक्ष = 1)

हालांकि, यह काम नहीं करता है शब्द (कुंजी) शब्द उचित वैक्टर से मेल नहीं खाए गए हैं

मैं धारणा के तहत एक बहुत सरल और अधिक सुरुचिपूर्ण दृष्टिकोण संभव है। लेकिन कुछ समय बाद, मैं इसे ढूंढने में सक्षम नहीं हूं। हो सकता है कि कोई यहाँ कोई मदद कर सकता है, या मुझे मौलिक तरीके से याद किया गया है।

क्या यह आप है चाहते हैं?

 % time lda1 = models.LdaModel (corpus1, num_topics = 20, id2word = dictionary1, update_every = 5, chunksize = 10000, पास = 100) आयात पांडा मिश्रण = [dict (lda1) [X]) x के लिए corpus1] pandas.DataFrame (मिश्रण) .to_csv ("output.csv")  

ios - Watchkit not calling willActivate method -


I was able to run my watch app basically during all the beta batches, but with recent releases this last week (8.2). ) My wishless method is rarely called. What happens is awake, as well as a spinner with spinning is called a clock stall. Has this problem happened to someone?

I've found that locking and unlocking tool (simulator) by typing command-L is will power Should be called I hope you do not need to do this on a real Apple Watch.


regex - PHP replace part of the URL in css file -


I need to convert related URLs into my server static urls in my CSS files.

For example, I have a CSS rule:

[/ public / images ...] or ['/ public / images ...'], or [. ./public/images ...] or ['..//public/images ...'] and I need to convert all of these URLs into my static server's CDN:

  / Public / images ... - & gt; //static.mysite.com/public/images ... '/ public / images ...' - & gt; '//static.mysite.com/public/images ...' ../ Public / Images ... - & gt; //static.mysite.com/public/images ...  

I wrote a regular expression to do this, but this does not work with '../' URL here Is:

  $ fileRawContent = file_get_contents ($ filePath); $ ReplaceContent = preg_replace ('/' ('\'? (? '\'. \\.). \ / Public \ / images. *) \ '? \) /', "($ Static server $ 1) , $ FileRawContent);  

This only works for / public / images, but .. / public / not for images ...

Please advise as I said . Thanks!

This PHP preg_replace describes you:

 Notice starts at  preg_replace ("/(')?(\.).(?/public\/images.*'?)/", "$ 1 $ static server $ 3" ​​// $ 1 , $ 3 at the end, $ fileRawContent);  

Test run:

$ staticServer = '//static.mysite.com'; $ FileRawContent = "'../public / images ...'"; $ Replacement content = preg_rele ("/ (')? (Ssi)? (ATC / public / image. *'?) /", "$ 1 $ static server $ 3", $ $ $ file content); Print $ replacement content;

Output:

  '// static.mysite.com/public/images ...'  

Similarly:

/ public / images ... - & gt; //static.mysite.com/public/images ... '/ public / images ...' - & gt; '//static.mysite.com/public/images ...' ../ Public / Images ... - & gt; //static.mysite.com/public/images ...

Regular Expression Explanation:

  ( ')? (\. \.)? (\ / Public \ /images.* '?)  

We start with the same quote in parentheses. It gives us 1) question mark ? and 2) It can capture it for interpolation in our replacement parameters, then we will have two duration . Wrap in brackets and make them optional ? . (They have been captured in the variable $ 2 , but we do not use it.) Finally we capture the public image path after zero or more characters. Are there. . * and an optional ? Single quote.


javascript - displaying an individual integer in webix -


I want to display one object (which changes, that's why I'm not coding it hard) I, however, does not display anything.

  var game_data = {sum: 1, yes_left: 3, nos_left: 1}; Var game_panel = {views: "form", id: "game_panel", lines: [{cols: [{template: '& lt; Span class = "main_title" & gt; Money: $ # sum # .00 & lt; / Span & gt; ', Data: {amount: game_data.amount}, align: "center"},}]};  

I have also tried to return it as a variable:

  template: function (game_data) {return '& lt; Span class = "main_title" & gt; Money: '+ game_data.amount +' .00  

How to obtain any idea?

The code you are using is correct. You can check the next work snippet

If you are planning to update this number dynamically, it would be better to use a slightly different syntax

  Id: "t1", Template: '& lt; Span class = "main_title" & gt; Money: $ # sum # .00 & lt; / Span & gt; ', data: game_data, align: "center"  

and update the number for, be sure to call the template. Refresh, as the template does not automatically track data changes

  game_data.amount + = 2; . $$ ("t1") refresh ();  


javascript - Calculating the height and width of a div and relating that to the window height and width -


I am installing a gallery that has a fixed amount of columns and each column will have a different amount of elements within them. The logic is that you rotate around the window width and height and are able to see the associated div of height and width. I have achieved the dynamic width of the element and successfully seen every column so div has successfully controlled - as you can see here in Bella (jquery is below). I do not understand that horizontally I am able to see each element successfully - but some vertical divs are cutting and it is not behaving in the same way as it happens horizontally if someone helps me So I will be very grateful!

  $ (document) .ready (function () {var winW = $ (window). Width (), winH = $ (window) .ite (), winWHalf = winW / 2, WinHHalf = winH / 2, $ cont = $ ("content"), contW = $ cont.width (), contH = $ cont.height (), diffX = (WinW - contW) / 2, diffY = (winH - ContH) / 2; var LastX = 0, last Y = 0; var moves Communication = function (e) {var x = e.pageX, y = EPPI; final S = ((x) * ( Console_log (last x, last y); $ cont.css ("conversion", "translation 3d"); Contrast / ww); Last Y = ((wi) * (contH / winH) / 2) + (0 - the last X) + "px," + (0 - the last y) + "px, 0)"); $ (Document) .ready (function () {var winW = $ (window). Width (), win = $ (window) .heet (), winWHalf = winW / 2, winHHalf = winH / 2, $ cont = $ (". Content"), contW = $ cont.width (), contH = $ cont (height), diffX = (winW - contW) / 2, diffY = (winH - contH) / 2; var last x = 0, Last y = 0; var moveContent = function (e) {var x = e.pageX, Y = e.pageY; last X = ((x) * (conte / windw) / 2); Last Y = ((Y) Console.log (Last X, Last Y); $ Cont.css ("Conversion", "Translation 3D (" + (0 - Ultimate X) + "PX," + ( 0 - last y) + "px, 0)");};  

sorry but for some reason Please see Bela.

You width $ (".content") based on the code> and calculating the height . Instead you should see the $ (window) or $ (Document) needs to be used for height , you would like to use a larger value to ensure that you fill the screen.


objective c - iOS Rotating Video Using AVMutableVideoCompositionLayerInstruction -


At the moment, whenever I export a video, it appears to rotate 90 degrees right, but I'm not sure That's why that's why. My current code is:

  AVURLAsset * videoAsset = [[AVURLASet alloc] initWithURL: self.video option: zero]; AVMutableComposition * Composite = [AVMutableComposition composition]; AVMutableCompositionTrack * compositionVideoTrack = [Mixing addMutableTrackWithMediaType: AVMediaTypeVideo Favorites Track ID: kCMPersistentTrackID_Invalid]; AVAssetTrack * ClipAvideoTrack = [[Video Asset Tracks with Media Type: AVMediaType Video] The Last Object]; [CompositionVideoTrack DanteMirenz: CMTMRMMMK (KCMTimeJero, VideoAssetActuration) Keytrack: ClavidArchac Time: KCMTimeGerman Error: Zero]; [ConstructiveTrack SetPreferencesFormat: [[[VideoAssetTrackwidth Media Type: AVMidetEpe Video] ObjectItindex: 0] Favorite Transformers]]; CGSize videoSize = [Clavidiotrack natural shape]; Caller * Parentleier = [Calair layer]; CALayer * VideoLayer = [Calair Layer]; VideoLayer.frame = CGRectMake (0, 0, videoSize.width, videoSize.height); ParentLayer.frame = CGRectMake (0, 0, videoSize.width, videoSize.height); [Parentlear adblayer: video layer]; AVMutableVideoComposition * Video Comp = [AVMutableVideoComposition videoComposition]; VideoComp.renderSize = [Clipidotracrack Natural Shape]; VideoComp.frameDuration = CMTimeMake (1, 30); VideoComp.animationTool = [AVVideoCompositionCoreAnimationTool Video Composercore AnimationWith Post ProcessingAs VideoLayer: Video Layer Inner: Parent Lawer]; AVMutableVideoCompositionInstruction * Instructions = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; Instruction. Timrange = CMTMRMMM (KCMTimeJairo, Mix Editing.); AVAssetTrack * VideoTrack = [[Mix Composer Tracks with Media Type: AVMidiaTape Video] ObjectAttindex: 0]; AVMutableVideoCompositionLayerInstruction * layerInstruction = [AVMutableVideoCompositionLayerInstruction Video CompositionLayer InstructionWidgetsetTack: VideoTrack]; Instructions. Layer directive [= Object with the NSARA array: Reconstruction]; VideoComp.instructions = [Object with NSSS array: Directive]; AVAssetExport session * assetExport = [[AVAssetExportSession alloc] initWithAsset: Mix Edit Pre-defined Name: AVAssetExportPresetMediumQuality]; AssetExport.videoComposition = videoComp; NSString * videoName = @ "output.mov"; NSString * exportPath = [NstemporaryDirectory () stringBuffing string: VideoName]; Ns URL * exportURL = [NSUr File URL Thick Path: Export Path]; If ([[NSFileManager default manager] filexsteth: ExportPath]] [[NSFileManager Default Manager] Removed OpenPath: ExportPath Error: Zero]; AssetExport.outputFileType = AVFileTypeQuickTimeMovie; AssetExport.outputURL = exportURL; AssetExport.shouldOptimizeForNetworkUse = Yes; [AssetExport exportAsynchronouslyWithCompletionHandler: ^ (zero) {sending_accommon (sender_pot_man_close ()), ^ {[self-exportedDidfinish: assetXport];}); }];  

I tried to use the following code to change it, and although it technically rotates the video, it reduces the video to a square, and I do not know if it How to extend the full screen to fit:

  CGFine transformer rotation = CGPhen transcnet macotation (MOPI / 2); CGAffineTransform translateToCenter = CGFint TransformMac Tronstation (1000, 1000); CGAffineTransform mixedTransform = CZF TransFormConCat (rotation, transatlotocenter); [Layer Setting Transform: Composite from time to time: kcmimejra];  

Any advice?


serversocket - Block socket connection for one port in JAVA -


So basically I want my serverocket.accept () to be applied to any other port except 1218 Can go Can I block by call this port because 1218 is connected to another thread?

I have good news and bad news The good news is that to avoid listening to a particular harbor You do not have to do anything special. The bad news is that any given serverket listens for a connection on a port only.

The port is that how many potential services customers want to connect with, some services listen to connections on many ports, but they need a separate socket for each one every There is no point for the server to listen to the port (and not one at all).

You can only separate one port number from 1218 when you tie your serversecet (whether through constructor or separately bind () ).


javascript - How minify an Angular Prj -


This is my problem ...

I create the next small exmaple with gruntFile.js And I can reduce it

This is an error for me:

  Unwanted error: [$ Injector: Named] module 'My app' is not available! You either misspelled the name of the module or forgot to load it. If a module is registering, make sure you specify the dependency in the form of the second argument. Http://errors.angularjs.org/1.3.11/$injector/nomod?p0=myApp  

This is a link to see my example:

<

">

Remove the first thing to start a ng-app =" myApp ", because he declared you twice You must follow the array annotation of dependency injection, to ensure correct mination without error, you have lost it within the directive.

Director

< Pre> angular.module ('MyApp'). Directive (' FireForm Directive ', [function] {return:' AE ', template: Answer:' js / directives / beerform / beerform_view '', radius: {}, controller: 'beerman_controller' / / controller added from the scene};} ]);

and delete ng-controller from your html template. & Amp; cdn

Comparing the javascript file locally to better performance

visual studio - Using intellisense and Vsvim -


I recently installed vsvim and was wondering how to do some things.

When there is a pump in intellisense and you provide some options, is there any way of choosing them without the use of arrow keys?

Vim breaks the flow.

Thanks in advance.

If you use ALT, intellisense is not transparent!

Edit Tool-Options-Keyboard these commands

Edit. Lineups - Edit Alt-P LineDown - Alt -n


How can I see each of tables from database in R? -


For example, under the "nycflights13" database, there are several tables, including flights and weather, etc.

  Library (nycflights13)  

After writing above, how can I see the actual information about the structures of table names, in that case I Do not know the name of a table

head (nycflights13) or str (nycflights13) do not work.

You can use the data function to view datasets in a single package Can specify and specify the package of interest.

  data (package = 'nycflights13')  

after which you can use str to view the structures .


ember.js - emberjs - dynamic computed property does not trigger classNameBindings -


I'm creating a mixin to validate the components with texFields it looks like this, I'm using < Code> Ember.defineProperty

  App.ValidationMixin = Ember.Mixin.create classNameBindings: ['isInvalid'] Input: Code> To create a CP immediately with a dynamic dependent key ( E) - & gt; @ _super.apply, Logic Setup: Amber.On 'didInsertElement', - & gt; As long as verification = @get ('validation') = l = @autocompleteElement () # is getting this compared to #dynamic property changes when it is starting, @get ('isInvalid') el.addClass' It was rather to use prop to add this - the indigenous' other el.removeClass' is - invalid 'verification Mixin: Ember.on' didInsertElement ', - & gt; Until verification = @get ('verification') return dynamicProperty = # logic dynamic property Ember.defineProperty to determine this 'isInvalid', Ember.computed dynamicProperty, 'validator.isSubmitted' - & gt; # Verification logic  

is the problem, I have to manually check for this.get ('isInvalid') instead the function of the function is being executed When a

Amber probably thinks that the property 'isInvalid' is not used anywhere and hence It does not update that I think that 'didInsertElement' is called after the classNameBindings property ... Try to output if this is the case Yonki it 'isInvalid' property template to check should be updated.


MobileFirst V6.3 folder common/js/services in design perspective -


I want to create a folder named "Services" below "General / JS". Unfortunately, Eclipse is confused with this name, while MFP design perspective. It does not display the contents of the folder, but instead I can see it in the service folder in Project Root.

As soon as I give some more names to my folder, everything is fine. This is not a big problem, but it can be interesting to understand that if any type of filter is applied in the design perspective.

If you open the Navigator view, you will see those files in either the Java EE or the design perspective Which you put in the normal \ js \ services folder. You will also see the property of the file in the properties view of the Design Perspective.

If you are in Project Explorer view, you will not see them in the context of Java EE or design.

This is a weird one we will see.


go - imported and not used error -


I did not know how to create a package and how to use it. I am using liteid and go 1.4.2, but this is all reproduction-able from the command line. I'm able to make it a size package but it does not load from the main package.

  GOPATH = D: \ src \ teaching \ golang GOROOT = c: \ go + teaching \ Golang \ pkg \ windows_386 size. A \ src \ packages package.go \ shape shape.go install shape - & gt; Make shapes. Prepare the package packages.go # package.d: \ src \ education \ golang \ src \ packages \ packages.go: 5: imported and not used: "size" D: \ src \ teaching \ golang \ src \ package \ Packages.go: 8: Undefined: Size D: \ src \ teaching \ golang \ src \ packages \ packages.go: 1 9: Undefined: circle  

shape.go

packages.go

  ... shape ) Float64 {sum: = float64 (0) _, v: = class size {sum + = v.Area ()} return amount} func main () {circle: = circle {x: 1, y: 2, radius : 2} FMT print  

Any ideas?

Size is defined in the shape package, you must reference it as shape.Shape


java - Selenium get .har file -


मेरे पास दो पृष्ठ अनुप्रयोग हैं:
/ लॉगिन
/ प्रोफाइल
मुझे .hir फ़ाइल पृष्ठ / प्रोफ़ाइल प्राप्त करना चाहते हैं।
जब मैं पृष्ठ / लॉगिन पर जाता हूं, तो कुकी को कुंजी = कनेक्ट.sid और value = "example value" के साथ बनाया गया है। यह कुकी अभी तक सक्रिय नहीं है। मैंने सक्रिय कनेक्ट.sid के साथ कुकीज़ जोड़ा।

  WebDriver webDriver = getDriver (); webDriver.get (LOGIN_PAGE); । WebDriver.manage () addCookie (connectsSId);  

यह काम नहीं करता क्योंकि लोड पेज के बाद, / लॉगिन एक नई कुकीज़ crated मैंने भी इस कोड की कोशिश की:

  WebDriver webDriver = getDriver (); webDriver.get (PROFILE_PAGE); webDriver.manage () deleteAllCookies ()।; । WebDriver.manage () addCookie (connectsSId);  

और यह काम नहीं करता है कुकीज़ जोड़ा गया था लेकिन यह बहुत देर हो चुकी है।

  WebDriver webDriver = getDriver (); लॉग इनपृष्ठ लॉगिन पृष्ठ = नया लॉगिन पृष्ठ (getDriver ()); लैंडिंगपेज लैंडिंग पेज = loginPage.login (); landingPage.openProfilePage ();  

इस कोड ने / लॉगिन पृष्ठ के लिए एक। किसी कारण के लिए, फ़ाइल को पृष्ठ के पहले कॉल के बाद ही बनाया गया है। मैं इस समस्या को हल नहीं कर सकता।

आप सभी अनुरोध और प्रतिक्रिया डेटा पर कब्जा करने के लिए browsermob प्रॉक्सी का उपयोग कर सकते हैं < / P>


ruby - Logstash error message when using ElasticSearch output=>"Failed to flush outgoing items" -


EE 1.4.4 and LS 1.5 and using Debian 4 on Debian. I start the logstation, it works fine for a few minutes, so I have a serious error to stop. To logstash I will have to delete recent databases stored in ES, this is the only way I have found. One more relevant fact is that elastic search looks ok, I can see old data in Kibana and the plugin head works fine. My Output Config: Output {Elastic Search {Port => 9200 Protocol => http Host => "127.0.0.1"}}

Any Help Will Be Appreciated :)

Full Error Message: Error on performing Bulk Action on Flexible Services Server 127.0.0.1: Finished Reading {: level =>: error}

Failed to flush outgoing items {outgoing_count = > 1362 ,: Exception => #,: Backtrace => ["/ Opt / LostStas / Seller / Bundle / jruby / 1.9" / Gem / Manicor-0.3.5-Java / Lib / Manti O / R.RB: 35: Initially '', '' Org / jruby / rubyproc.java: 271: incall '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.3.5 -java / lib / manticore / response.rb: 61In call '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/manticore-0.3.5-java/lib/manticore/response.rb:224: Incall_once ', "/ opt / logstash / vendor / bundle / jruby / 1.9 / gems / manticore-0.3.5-java / lib / manticore / response.rb: 127: in code' '," / opt / logstash / vendor /bundle/jruby/1.9/gems/elasticsearch-transport- 1.0.7 / lib / elastic search / transport / transport / http / manticore.rb: 50: inperform_request '', "o rg / jruby / rubyprog. Java: 271: Call '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.7/lib/elasticsearch/transport/transport/base.rb: 187: inperform_request' ', "/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.7/lib/elasticsearch/transport/transport/http/manticore.rb:33:in display_rext '," / opt / logstash /vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.7/lib/elasticsearch/transport/client.rb:115:inperform_request ', "/ opt / logstash / seller / bundle / jruby / 1.9 / gemstone / Elastic search-api-1.0.7 / lib / elasticsearch / api / actions / bulk.rb: 80: bulk in '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-ext-lasticsearch- 0.1.18-java / lib / logstash / outputs / elasticsearch / protocol.rb: 82: inbulk ', "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-stylisticshach-0.1.18- Java / Lib / Logstash / Output / LolalisticWerb.RB: 413: Submit to "," /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-0.1. 18-java / lib / logstash / output / elasticsear Ch.rb: 412: insubmit '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-0.1.18-java/lib /logstash/outputs/elasticsearch.rb:438: "," /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-0.1.18-java/lib/logstash/outputs/elasticsearch in flush .rb: 436: inflush '"," /opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rbailand19:in buffer_flush "," org / jruby / RubyHash.Java: 1341: Inch '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rb:216:in buffer_flas', "/ opt / LogStation / Seller / Bundle / jruby / 1.9 / Gem / Stud- 0.0.19 / Leab / Stud / Buffer. RB: 193: Inferphrash '', '/ OPT / LostStep / Vendor / Bundle / Jarbu / 19 / Games / Stup 0.0.19 / Leib / Studio / Buffer. RB: 15 9: buffer_receive '', '/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-0.1.18-java/lib/logstash/outputs/elasticsearch.rb:402: Unknowingly, "/opt/logstash/lib/logstash/outputs/base.rb:88:Hen handle", "(eval): 1070: Initialize", "org / jruby / rubyArray.java: 1613: in EA Cha "," org / jruby / rubyEnumerable.java: 805: inflat_map "," (eval): 1067: initially '', 'org / jruby / rubyprroc.java: 271: incall' ', "/ opt / Logstash / Lib / logstash / pipeline.rb: 279: In Output '', '/opt/logstash/lib/logstash/pipeline.rb:235:inoutputworker' "," /opt/logstash/lib/logstash/pipeline.rb: 163: `start_outputs'"]: :: level =>: warning}


dependency injection - How to pull type from Properties Settings StringName in C# -


I am performing dependency injection.

I want to bind an interface to an object that can change. What I am doing is establishing many different connections, so that they all can communicate in the same way. I want an option to point to an object or any other, but I have to manage it through config.

That's why my problem is.

I am currently able to do this:

  kernel.bund & lt; Interface name & gt; (). & Lt; ObjectName & gt; ();  

< Code> kernal.Bind & LT; InterfaceName & gt; () & Lt; Properties.Settings.Default.ObjectName & gt; ();

This definitely does not work because it is trying to set some kind of asset.

That is what I am trying to do.

I have set the properties ObjectName then do the following.

  type myType = Type.GetType (properties.Settings.Default.ObjectName); Kernal.bind & lt; InterfaceName & gt; () & Lt; MyType & gt; ();  

I can not solve my type.

Please help.

html - How to Add Fonts to a Website -


Want to add a font to the website?

CSS file:

  @ font-face {font-family: smFont; Src: url (optima-regular-webfont.woff); } .smfont {font-family: smFont; }  

HTML file:

About & lt; Strong class = "smFont" & gt; Company & lt; / Strong>

I have the top but the font has not come out properly. Is my code wrong?

Make sure your path is correct, if you see the console while visiting, You can see the unsuccessful requests in the files.

He is currently targeting the / css / directory for them when they are in the root directory, then simply changing the CSS in the following should solve the problem.

  @ font-face {font-family: smFont; Src: url ("../ optima-regular-webfont.woff"); }  

ruby on rails - Bundler could not find compatible versions for gem "sass" -


मैं मध्यस्थ 3.3.9 और

  मणि 'sass-rails', ' ~ & gt; 4.0.3 'मणि' बूटस्ट्रैप-सास ',' ~ & gt; 3.3.1 'मणि' बूटस्ट्रैप-टाइमपेक्चर-रेल 'मणि' sass ',' ~ & gt; 3.2.19 ' 

जब मैं बंडल इंस्टॉल चलाता हूं, तो मुझे यह त्रुटि मिलती है:

  बंडलर रत्न "sass" के लिए संगत संस्करण नहीं मिल सका: Gemfile में : मध्यस्थ (~> 3.3.9) रूबी एसस पर निर्भर करता है (& lt; 4.0; & gt; = 3.4.0) रूबी sass (3.2.19)  

मैं यह पास कैसे कर सकता हूं ?

आप एक निर्भर मणि संघर्ष समस्या हो रही है आपने sass-rails को बंद कर दिया है, इसलिए यह sass को नहीं ला सकता है जो कि मध्यस्थ के संस्करण को पूरा करने के लिए पर्याप्त है, फिर से चल रहा है।

आपको या तो बिचौलिया के संस्करण को कम करने की आवश्यकता है, जिसका उपयोग आप कर रहे हैं, या sass-rails का संस्करण बढ़ाएं।

P>

mysql - How to aggregate database entries? -


I am writing a tool that shows the price (and price change) of many markets, prices come from each other website and By the way, a mysql5 database is stored in:

table_market:

PK: timestamp | Base_currency | Quote_currency | Price

This means that I have 600 entries in 10 markets which are after one minute, which is very high. /.

So my idea is to gather the data: I want to accumulate the price for the last 5 minutes for every second old entries I want to collect data so 5 minutes is only one row 30 minutes For older entries I also want to collect them ..

So far I thought that to create a table for each market, but it will only divide things :( Mer The question is:

the real touch :)

Depending on the prices you are talking about, it would be better to save the data so that it changes. Therefore, keeping it in place of every other storage, store it only when it is different from the final price.


Templates compiled to javascript in a Java environment -


Coming from Node.js and now working with Java I

Before I used EJS templates, then a JS file that works to call JS with parameters, these functions returned an HTML string, which I used to use I can do this to update the idea.

The great thing about this is that I have different templates in my templates (EJS) then Dynamic Grunt / EJS (I think, this is the internal argument of CSS.) Templates in a function I was just converting all of them, and finally to make one file usable in my app, just call me the function, give the argument and this is the one: Dynamically generated one view M The Creeper.

I want to get the same in a java environment, using ant, perhaps Maven, but I do not know where to look for me to not be a new Java novice.

Edit:

I'm talking about client-side templates, I just write HTML code inside the elite-JS stars and divide them into separate files. Conservative methods so that I can make them easier. I only need to use JS, not Java, but I need to "compile" Java environment, using ant.

This is somewhat similar, and, so you can see whether other useful answers.

There is an agreement that it seems, in which a Java-implementation compiler (among other flavors) can be executed as an ant target. This is a reasonless template, so you may want to find another solution.

Since the node from the ant. It is possible to call JS script, it seems that the node. There is an artificial ban for not being JS. If you can persuade your team to allow Node.js, then you have a lot of options and flexibility in the template options.

Node. Js is not related to any-or java tool. There are lots of rooms for both in project, and I have worked on C # projects that node Using JS, like I have worked on projects using JRB, Java and Rail. None of those technologies covers others.

Note that I am not recommending that you nod people as an environment Switch to JS, move existing code, or use grunt, but if this is a useful tool that you are familiar with, then I can not think of any good reason why you should not use it .


random.sample in python implies choosing uniformly? -


random.sample (populated, K) unique with a different person in a specific and randomly different person in Python Choosing the persons means I am right? If I have never seen a uniform part, I think it should be like this. Sorry, if this one is a duplicate as the following, I had initially given the subject of my concern, but since I do not have enough population, someone sprayed my answer. Anyway, any comments are greatly appreciated.

related:

Of course. There is a common opportunity for every item to be drawn.


Android RatingBar: getProgressDrawable doesn't cast to right Class -


मैं

का उपयोग कर रहा हूं

कोड की यह पंक्ति

< पूर्व> परतनिरपेक्ष तारे = (परतनिर्धारण) rating_bar.getProgressDrawable ();

मेरे नेक्सस 4 एमुलेटर एपीआई v21 पर ठीक काम करता है मेरे गैलेक्सी एस 4 एपीआई v19 पर एक ही कोड की कोशिश करते समय, मुझे निम्न त्रुटि संदेश मिलता है:

  द्वारा कारण: java.lang.ClassCastException: android.support.v7.internal.widget.TintDrawableWrapper नहीं कर सकता क्या हो रहा है?  

मैं नवीनतम बिल्ड टूल्स 22 के साथ निर्माण कर रहा हूं, मेरा लक्ष्य एपीआई 22 भी है ।

क्या होता है स्पष्ट रूप से त्रुटि संदेश में समझाया गया है:

  TintDrawableWrapper एंड्रॉइड के लिए डाली नहीं जा सकतीं। Graphics.drawable.LayerDrawable  

समर्थन ओब रेट्रो संगतता को संभालने के लिए एक आवरण बनाता है, आपको इसे खाते में लेने की जरूरत है लिब कार्यान्वयन पर एक नज़र डालें, यह संभवतः एक लेयरड्रायबल के आसपास लपेटता है

आपको निम्न की कुछ पंक्तियों के साथ कुछ करना होगा:

  परतनिर्दिष्ट तारों = मिलना प्रगतिशील (रेटिंग_बार); } निजी लेयरड्रॉवेट होग प्रोग्रेस ड्रेवबल (रेटिंग बायर रेटिंगबार) {यदि (बिल्ड। संस्करण> gt; = LOLLIPOP) {रिटर्न (लेयर ड्रॉएबल) रेटिंगबार.गेट प्रगतिशील (); } Else {// Google के समर्थन कार्यान्वयन पर आधारित LayerDrawable, // शायद एक सरल findViewById ()}}  

jsf - What should I use to view for nested data? -


I want to make a list of faculty at university. Then I want to make a list of departments in the selected faculty, then I want to create a list of lessons in the selected department.

  Faculty> | Selected faculty | Departments & gt; | Selected Department. & Gt; List of text  

What should I use to see this structure? Which figure is better for me? I use primfaceous 5.0 in the scene layer.

DataAttabel

You must apply some listeners (i.e. To bring your next list on the basis), but this will not be the authentic task because primetime datatates provide the selection feature (click the row, button, ...) to see just the showcase link below, see an overview.

Showcase:

Master Extension

This is part of the primetime extension, but seems to fit your needs because most arguments are ready to use

tree

either horizontal () or vertical (): box (Ajax: update list view, update breadcrumb, ...)

Showcase :

If you want to display your data in a table, consider using TreeTable ().

However, it will need to handle the treeoid and it will be more difficult to create the IMO, the TreeOnDynamically


pyqtgraph - Text appearing flipped in setLabel item -


I use plot plot to plot a graph and cross hair feature to display coordinates using the mouse point I am here. But the coordinates are flipped in relation to X-X. I will rotate the text by 180 degrees w.r.t x-axis. I'm keeping that line here "label". Set text ("x =% 0.1f, y =% 0.1f"% (mousepoint.x), mousepoint.Y ()) "" thanks


jquery - Datatables Data Method -


I have recently created a datalet that is pulling data from .txt file with AJAX. Although I am quite new to AJX, Datlet etc. And I think that using a .txt file or using internal data is probably not the best practice.
I am curious to know which other methods can be used to make this method even more effective, because this .txt file is getting bigger, and is not the optimal way of adding dates. I have seen the use of SQL, but it is not sure how you can get the data within a SQL table, and then add the dataset.

This is not my area of ​​expertise, but I want to expand my skills.

The code, by dragging the code from .txt to the script.

  $ (document) .ready (function () {var table = $ ('# dt_example') .Datatale ({dom: 'c & lt; "clear"> lfrtip " "Default.content": ''}, {"class_name": "description-control", "sequential": incorrect, "data": "ajax": "objects.txt", "column" {"Data": "project"}, {"data": "project"}, {"data": "status"}, {"data": "contractor"}, {"data": "section"}, Order ": [[1, 'ACC']],});  

});


java - Why doesn't my delay happen? -


Currently developing an app where I need to take several WiFi measurements, take the average of these measurements and Collect average however I have found that I have to implement a delay between measurement otherwise there is not enough time to see any difference between the measurement.

In the Handler.postDelayed () method, I have tried to implement the delay of 2000ms, however, when I look at the Timestamp of the logs generated by Sakthi, there is no delay.

Any help would be greatly appreciated :)

  @Override protected void onCreate {bundled saved instenstate} {super.onCreate (SavedInstanceState); SetContentView (R.layout.activity_takewifi); Last string [] strArr = new string [60]; For {i.e. I / O; i ++;} {strarr [i] = "blank"; } WiFi Manager WiFi = (WiFi Manager) Receive System System (Ref. WIFI_SERVICE); Final integer = wifi.getWifiState (); If (state == wifi manager.WIFI_STATE_ENABLED) {rodata rd = new radata (); Toast. Maketext (Takewee, "Take RSS Measure, Still Stop!", Toast. LNNGHHORT). Show (); For (int a = 0; a & lt; 30; a ++) {wifi.startScan (); Last Handler Handler = New Handler (); Handler Post (New Runnabal) ({Overwrite Public Wide Run) ({handler.post Delayed (This, 2000);}}); & Lt; ScanResult & gt; Results = wifi.getScanResults (); String index = (string) results.toString (); Int = 0 for; Int ifCount = 0; For (string rate: index. Split (",")) {if (((count% 5 == 1) || (count% 5 == 3)) & amp; amp; amp; (Ifcount & lt; 60)) {strarr [IfCount] = Rival; Strarr [ifCount] = strarr [ifCount] .replace ("bssid:", "bssID:"); Strarr [ifCount] = strarr [ifCount] .replace ("Level:", "Level:"); Ifcount ++; } Count ++; } For (int check = 0; check & lt; 60; check ++) {log d. ("Taqui", "Strachar [" + Czech + "]:" + Strat [check]); } RD.SetsTrar (Straur, RD); } Last string [] temp = rD.getStrArr (rd); For (int b = 0; b & lt; 20; b ++) {strarr [b] = temp [b]; } (Int i = 0; i  

Change your handle with this and whatever you want to delay it.

  new handler (). Post Deliad (new Rnnabl () {@Override public void run ()} / / / you need to go inside her Rnnbl who want to delay}}, 2000);  

is it possible to query project access for users via REST-API in VersionOne -


मैंने निम्नलिखित की कोशिश की:

http: //

यह उपयोगकर्ताओं को तीन समूहों, सदस्य, स्वामी और दर्शकों, हालांकि यह परियोजना के खिलाफ प्रत्येक सदस्य का रोल नाम नहीं देता।

क्या संस्करणऑन में REST-API के माध्यम से किसी भी प्रोजेक्ट के लिए "सदस्य भूमिकाएं" पूछना संभव है?

धन्यवाद

वर्जनऑन एपीआई अलग-अलग परियोजना भूमिकाओं को प्रबंधित करने के तरीकों का खुलासा नहीं करता है। भूमिकाओं के संदर्भ में एकमात्र जानकारी जिसे आप प्रत्येक सदस्य के लिए प्राप्त कर सकते हैं, वह डिफ़ॉल्ट भूमिका है। सदस्य। डिफॉल्टरोल .नाम।


javascript - AngularJS - ngRoute - Callback after view-load finished -


I try to apply animation-dialog with AngularJS. So my APP starts and shows a dialogue (all is well), but there are images in the dialog that are outside the viewport (because I exclude them from the viewport with my CSS) and then the dialog It should be animate in opening time when this material has been loaded.

For this I attached a class for the images, so they are out of the viewport. While removing the class, animate in the viewport all well. But

But: After the opening of this dialogue, how can I AngularJS make them live?

For debugging,}} and hyperlinks:

  & lt; Div class = "dialog bg-turkey" id = "mainpage" & gt; & Lt; Img src = "picture / home page-1png" id = "homepages -1" ng-square = "{nook: closed}" & gt; & Lt; Img src = "images / mainpage-2.png" id = "mainpage-2" ng-class = "{first: closed}" & gt; & Lt; Img src = "picture / home page-3. Pgn" id = "main page-3" ng-square = "{unassigned: closed}" & gt; & Lt; Img src = "picture / home page-4pn" Id = "mainpages-4" ng-square = "{unassigned: closed}" & gt; {{Close}} & lt; An NG-Click = 'Chetan ()' & gt; Open & lt; / A & gt; & Lt; / Div & gt;  

Here is the dialog controller:

  var loadingController = ["$ scope", function ($ scope) {$ scope.closed = true; $ Scope.animate = function () {Warning ('Los'); $ Scope.closed = false; }; $ Scope $ ('$ ViewContentLoaded', function () {setTimeout ($ scope.animate, 100);}); }];  

And here's the path:

  app.config (function ($ route provider, $ compiled provider) {$ routeProvider.when ("/", {controller : OpenController, templateUrl: 'views / loading.html'}) Otherwise ({redirectTo: "views / welcome.html"})}}  

Now when you open that dialogue, Elleryt (Debugging purpose) appears, but variable changes do not occur. Just when I click on the hyperlink, the alert appears in variable changes and then the animation starts ..

What do I do?

gcc - C static library cannot link with librt -


I have to create a static library (this is not the option to create a dynamic one), and I have a function that is stable library Something like this:

somelib.h:

  # that uses  timer_create  from  time.h  Include & lt; Time.h> Int do_something (zero);  

somelib.c:

  int do_something (zero) {timer_t timer; Straight sigevent sevp; Sevp.sigev_notify = SIGEV_SIGNAL; Sevp.sigev_signo = SIGRTMIN; Sevp.sigev_value.sival_ptr = NULL; Int rate = timer_credit (CLOCK_MONOTONIC, & amp; sewep, and timer); Timer_delete (clock); Return 0; }  

The code is actually null and it is necessary to link against the libel to clarify my progelom, which is as follows:

When I compile the sombab I am C:

  GCC-CoAmailib.O Amelib CR-LRT  

and create a static library:

  AR RCS somelib.a somelib.o  

The following error is found when linking:

  gcc -o someexec someexec.c -lrt ./somelib.a  

returns:

  somelib.c :( text + 0x30): Undefined context for 'timer_create' somelib.c :( .text + 0x44): Undefined reference to `timer_destroy ' 

This is a minimal example of my problem. I'm not sure if this can be fixed at all, because I understand that static liability will have to know the place of the Libre at the time of its creation and since it is dynamic, it is a static library version yet still Libraries do not use much time, so I want to know that there is no way to do something like that.

Compiler Edition: GCC 4.8.1 No other flag set.

GCC-CoOmail Somelib.c -lrt

This is the only compilation, -lrt is irrelevant here.

GCC-O Something XACXAk-LRT / SOMBBAA

Orders to order / library cases. Try ending

-lrt , then it should work.


javascript - Angularjs orderby objects keys -


So, I am trying to create a sorting list in the Attributes. Once a person clicks the name of the value, it updates the dom and displays the data accordingly. Bracelets, charms, and so on ... I know that I can do something like this:

Charms', 'ear kali', ...]; // sorting option $ scope.sort = 'bracelet'; // Set a default sortba item $ scope.active = function (x) {return x === $ scope.sort? 'Active': ''; }; $ Scope.setSort = Function (type) {$ scope.sort = type.toLowerCase (); };

But this is just an object I have several objects coming from the server. Here is my category object:

  {"Pandora": {"id": "1", "s1": {"d1" "cube", " "D6": "Jewelry", "D5": "Pendant", "D7": "Bracelet", "D2": "Cheams", "D3": "Earrings", "D4": " Necklace "," D6 "rings"}}}  

I'm reading that you can not use an order of angles without the array of objects. I have this code in my controller:

  $ scope.catData = [];  

Then I have a factory which The server goes on to catch json

  dataFactory.getCat (). Then (function (res) {$ scope .catData = res.data;});  

here My code looks like

  & lt; li ng-repeat = "catData" (key, value) & gt; & lt; a href = "#" data-id = '{ {Value.id}} 'class = "anchor" & gt; {{key}}  gt; & lt; ul class = "sub" ng-class = "{true:' active slides'} [Value.id == 1] "& gt; & lt; span ng- repeat =" hi value.s1 " 
  • I & gt; {{Hi}} & lt; / a & gt; & lt; / li & gt; & lt; / span & gt; & lt; / ul & gt; & lt; / li & gt; / Code>

    I'm thinking that when I set $ scope.catData in an array, then set $ scope.catData = res.data Override I can set the $ scope.catData = [res.data] but I do not think it's the right way to do it (or maybe?).

    < P> Thanks ng click and

  • > N

    Below is an example and a JSFiddle:

    HTML

    Some display text which is $ scope.he var -> gt; & lt; H2 ng-model = "hi" & gt; {{Hi}} & lt; / H2 & gt; & Lt; Ul ng-repeat = "obj in data" & gt; & Lt ;! - Repeats data and includes function calls for value - & gt; & Lt; Li ng-repeat = "entry in obj.s1" ng-click = "update" & gt; & Gt; Button ng-value = "{{entry}}" & gt; {{Entry}} & lt; / Button & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt;

    JS

      var app = angular Module ('myApp', []); // your data plus var myData = "... some JSON data ..."; App.controller ('Pandora Controller', ['$ scope', function ($ area) {$ scope.hi = "Select a pandora product:" $ scope.data = myData; $ scope.update = function (val) { $ Scope.hi = val;}}]));  


    html - How to fetch xml record from different remote machines -


    We have 3 XML files which are located on 3 different remote machines, when the user goes ahead for a query In which he records 4 details which is nothing, after matching these 4 attributes, I want to show the result to the user in my XML files but my code output is only matched with one attribute, I have all the 4 attributes After match matching Display wish, so please help me


    AngularJS | Set Path Parmeter while using $http.get method -


    I have a GET endpoint with the URI as the / user / user-id 'User ID' path variable is here.

    How can I set path variation while requesting a GET?

    This is what I have tried: -

      $ http.get ('/ user /: id', {params: {id: key}}); Instead of changing the path variable, the ID is added as the param absolute i.e. my debugger request code to  'http: // localhost: 8080 / user /: id ? Id = test ' 

    My expected solution should be URL' '<$ Http's parameter is for the object query string, so you have passed the key-value passed in the parameter Combination output contains query string key and value.

      $ http.get ('/ user', {params: {id: "test"}});  

    is created: http: // localhost: 8080 / user? Id = test

    If you need http: // localhost: 8080 / user / test , you either:

      < Li>

      You can create the URL yourself,

      $ http.get ('/ user /' + id);

    1. Or, use $ resource (especially $ resource.get $ resource). It's a bit cleaner.


    c# - Storeasync() is giving exception in windows 8 but working fine in windows phone 8 -


      स्ट्रीम सोकेट सॉकेट = शून्य; डेटा वाइटर डेटाट्रार = नल; डेटाराइडर डेटारिडर = नल; सॉकेट = नया स्ट्रीमसॉकेट (); Datawriter = नया डेटाड्राइटर (socket.OutputStream); DataReader = नया DataReader (socket.InputStream); सार्वजनिक async टास्क & लेफ्टिनेंट; बाइट [] & gt; Sendreceive (बाइट [] बाइट्स) {try {datawriter.WriteBytes (बाइट्स); Datawriter.StoreAsync () का इंतजार; // अपवाद यहाँ} पकड़ (अपवाद पूर्व) {पूर्व; }} // सॉकेट सॉकेट = नया स्ट्रीमसॉकेट () कनेक्ट करें; सॉकेट की प्रतीक्षा करें। कनेक्ट एसिंक्स (rfcommService.ConnectionHostName, rfcommService.ConnectionServiceName, SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);  

    अपवाद आता है: फ़ाइल का नाम 'system.InvalidOperationException' का एक पहला मौका अपवाद है filename.exe

    अतिरिक्त सूचना: एक विधि को अप्रत्याशित समय पर बुलाया गया था। (HRESULT से अपवादः 0x8000000 ई)

    कृपया कोई मदद कर सकता है।


    python - When writing to a csv file, why is each letter in a column? -


    मैं उपयोग कर रहा हूँ कोड:

      import urllib2 import csv से bs4 आयात BeautifulSoup url = "Http://en.wikipedia.org/wiki/List_of_ongoing_armed_conflicts" सूप = खूबसूरत सूप (urllib2.urlopen (url)) fl = ओपन ('locations.csv', 'w') def अद्वितीय (देश): देखा = सेट ( ) देशों में देश के लिए: एल = country.lower () अगर एल में देखा: देखा जारी रखें। (एल) उपज देश locs = [] सूप में पंक्ति के लिए। चयन ('table.wikitable tr'): कोशिकाओं = पंक्ति यदि कोशिकाओं में स्थान के लिए कोशिकाएं हैं, तो खोज_ल ('टीडी'): [3] .find_all (टेक्स्ट = ट्रू): locs.extend (location.split ()) locs2 = [] अनन्य स्थानों (स्थानों) के लिए: स्थानों = locs2 सॉर्ट किया गया (लोकस 2) में मूल्यों के लिए (स्थान.split ()) प्रिंट सॉर्ट किया गया (लोकस 2) लेखक = csv.writer (fl) writer.writerow (['location']): writer.writerow (values) fl.close ()  

    जब मैं लिख रहा हूँ, कोड को प्रिंट करता हूं, मुझे u ' मिलता है प्रत्येक तत्व के सामने जो मुझे लगता है कि यह इस तरह से काम कर रहा है। मैंने .strip (u ') का उपयोग करने की कोशिश की लेकिन मुझे यह एक त्रुटि मिलती है कि .strip का उपयोग नहीं किया जा सकता क्योंकि यह एक सूची है मैं क्या कर रहा हूं?

    locs2 स्ट्रिंग्स के साथ एक सूची है, न कि सूचियों की एक सूची जैसा कि आप एक पंक्ति के रूप में व्यक्तिगत तार लिखने का प्रयास कर रहे हैं:

      क्रमबद्ध (locs2) में मान के लिए: writer.writerow (मान)  

    यहाँ < कोड> मान एक स्ट्रिंग है, और writerow () इसे एक अनुक्रम के रूप में मानता है

    यदि आप सभी स्थानों को एक पंक्ति के रूप में लिखना चाहते हैं, तो पूरी सूची को लेखक। लेखक () :

      writer.writerow (सॉर्ट किया गया (locs2))  

    यदि आप के लिए एक नई पंक्ति लिखना चाहते हैं प्रत्येक व्यक्तिगत स्थान, इसे सूची में पहले लपेटो:

      सॉर्ट किए गए स्थान (locs2) के लिए: writer.writerow ([location])  

    आप डॉन स्ट्रिंग से u उपसर्गों की आवश्यकता नहीं है; यह सिर्फ पायथन आपको बता रहा है कि आपके पास यूनिकोड स्ट्रिंग ऑब्जेक्ट्स, बाइट स्ट्रिंग ऑब्जेक्ट नहीं हैं:

      & gt; & gt; & gt; 'एएससीआईआई बाइट स्ट्रिंग' 'एएससीआईआई बाइट स्ट्रिंग' & gt; & gt; & gt; 'एएससीआईआई यूनिकोड स्ट्रिंग' .एकोड ('एएससीआई') यूएसएसीआईआई यूनिकोड स्ट्रिंग ' 

    अगर आप पायथन और यूनिकोड के बारे में अधिक जानना चाहते हैं तो निम्न जानकारी देखें:


    javascript - Issue with nested asynchronous function not returning data in time -


    I rely on a component, i.e. the which returns a value function for it it occurs.

    Unfortunately, I'm not sure how to return something back from the time of the nested asynchronous function ( addressAutocomplete () ):

      $ Scope.chooseAddress = function (input) {var results = []; If (Input) {geolocationService.addressAutocomplete (Input, Function (Data) {Results = Data. Delegation; // Asynchronous and will be removed very late ...}); } Return Results; // I have to return something to my function ...};  

    As long as the addressAutocomplete function is complete, the result var has already been returned and it is definitely an empty array ... < / P>

    Can anyone please help?

    You need to expose the fact that the call to select the asynchronous of the callees Select you can get it by returning it.

    Update

      $ scope.chooseAddress = function (input) {var deferred = $ q.defer (); If (input) {geolocationService.addressAutocomplete (input, function (data) {deferred.resolve (data.predictions);}); } And (deferred.resolve ([]);} Refunded Advertise;};  

    Then you type selectAddress such as

      

    python - Django datatable view related fields -


    I'm confused with this one I'm using to show data from the model However, I get an error: "There is no 'replacement' feature in the 'Tupal' object. Is this a model type or a conversion problem?

    My lists

      class CustomerList (BaseDatatableView): Model = Profile column = [("id", 'user__id'), ("name", 'customer__ name'), 'abn', 'street', 'suburb', 'post_code', 'state', 'mobile' ] Order_class = = [("id", "user_id")] max _display_length = 500 def render_column (auto, line, column): pprint.pprint (globals ()) pprint.pprint (local ()) if column == 'mobile': return str (line.mobile) Other: return super (customerlist) , Self) .render_column (line, column) def get_initial_queryset (self): return customer.officefileter (client_id = self.request.user.profile.client id)  

    my model

    Customer class (models.Model): name = models.CharField (max_length = 100) Client = Model. ForeignKey (Client) Date_created = models.DateField (auto_now_add = true, n Ull = true, empty = True) history = historic Record () def __unicode __ (self): return self Name class profiles (models.Model): user = models.OneToOneField (user, primary_key = true, related_name = 'profile') abn = model.carfield (max_land = 11, help_text = "Australian business number") road = model Kharefild (maximum_long = 100) suburban = model. Kharifild (max_long = 100) client = model. Forinz (client, empty = true, default = 1, zero = true) customer = model. Foreign (customer, empty = true, zero = true) history = history history () postcode = model WorldField (maximum_language = 100) state = model.Churchfield (max_long = 10) country = as model to 2 decs # [estimated goal] mobile = PhoneNumberField (empty = true, empty = True) Avatar = Models .carfield (max_length = 255, default = "", empty = true) invite_token = models.CharField (max_length = 128, default = "", empty = true) def __unicode __ (self): return self.user.get_full_name ()


    Enforcing implicit relationships in SQL -



    Enforcing implicit relationships in SQL -

    i'm having hard time figuring out if there way enforce implicit relationsships in sql when creating database structure. on abstract level, want model following:

    a person can belong 1 or many workfield's, workfield can have 1 or many sub-workfield's person can belong to. if person belongs 1 or more sub-workfield's, must belong parent workfield's.

    is there way enforce relationship in sql or need in application layer?

    you can enforce in database. 1 method have 4 tables: person, workfield, subworkfield, , personworks.

    the first 3 pretty self-explanatory. subworkfield table have column workfieldid have foreign key relationship workfield. column subworkfield.subworkfieldid primary key, , column pair subworkfieldid, workfieldid declared unique. latter declaration redundant helpful enforcing 1 of conditions.

    the personworks table have 3 (relevant) columns:

    personid references person(personid) workfieldid references workfield(workfieldid) subworkfieldid references subworkfield(subworkfieldid)

    each have foreign references suggested. when reference workfield only, subworkfieldid null.

    in addition, there more 1 more foreign key reference:

    foreign key (workfieldid, subworkfieldid) referenes subworkfieldid(workfieldid, subworkfieldid)

    and, completeness, might add:

    check (workfieldid not null)

    this construction takes advantage of how null values handled foreign key references. if key or part of composite key null, foreign key reference not checked. hence, can have reference subworkfield table, , used when info populated.

    sql

    sql - Create table from nth result set of stored procedure -



    sql - Create table from nth result set of stored procedure -

    i have stored procedure returns 4 result sets. results sets have lots of columns.

    what's best way create table out of each result set? info types , schema in tables should same ones result sets.

    i know can create table selection:

    create table table_name select * users

    so there way select result set stored procedure execution??

    while covered in chat, should still have reply others might wondering same thing.

    the way access specific result set out of multiple results sets, , within context of t-sql, via sqlclr. using c#, vb.net, or .net language, utilize sqldatareader can access result sets separately.

    the sqlclr proc exec existing t-sql proc , can either spit out single result set (assuming input param specify 1 homecoming result set) or separate connection , straight phone call insert statements 4 @ same time (although @ point console app or windows form or whatever).

    sql sql-server tsql

    javascript - Refresh an image if new image is found -



    javascript - Refresh an image if new image is found -

    i refreshing images webcams every sec on app. problem have if few seconds image not retrieved photographic camera (which happens frequently) end broken image. have refreshes if , when new image found.

    so far have

    var int_time = setinterval(function() { var myimageelement = document.getelementbyid('myimage'); myimageelement.src = '<%= evercam_api %>cameras/<%= @camera["id"] %>/snapshot.jpg?api_id=<%= current_user.api_id %>&api_key=<%= current_user.api_key %>&rand=' + new date().gettime(); }, 1000);

    is possible stop refresh if image not retrieved?

    following snippet help.

    solution:

    1) create dynamic image object

    2) bind onload event

    3) set src of dynamically created image object desired new image link

    4) on success of loading dynamic image, replace original tag or set src of original image tag latest image link

    this avoid problem of broken image

    code:

    var int_time; (function(){ var el = document.getelementbyid('myimage'); function loadimage () { var img = new image() , src = '<%= evercam_api %>cameras/<%= @camera["id"] %>/snapshot.jpg?api_id=<%= current_user.api_id %>&api_key=<%= current_user.api_key %>&rand=' + new date().gettime();; img.onload = function() { if (!! el.parent) el.parent.replacechild(img, el) else el.src = src; } img.src = src; } int_time = setinterval(loadimage, 1000); }());

    javascript image function refresh

    C struct pointer as argument: making permanent changes to the struct -



    C struct pointer as argument: making permanent changes to the struct -

    this code attempting order series of nodes priority, thing is, 1 homecoming function sort nodes, have done not persist. here simple code below followed output.

    #include <stdio.h> #include <stdlib.h> #define null 0 typedef struct node{ struct node * next; struct node * prev; int priority; }node; struct node nodes[5]; struct node * head = null; node * function( node * phead, node * top){ node * pos = top; if(top == null){ top = phead; } else{ if(top->priority < phead->priority){ top = phead; phead->prev = pos->prev; phead->next = pos; pos->prev = phead; } while(phead->priority < pos->priority){ pos = pos->next; if(pos == null){ pos->next = phead; phead->prev = pos; phead->next = null; homecoming top; } } (pos->prev)->next = phead; phead->prev = pos->prev; phead->next = pos; pos->prev = phead; } homecoming top; } void printnodes(){ node * pos = head; while(pos != null){ printf("priority order!:::::%d\n", pos->priority); pos = pos->next; } } int main(){ nodes[0].priority = 10; nodes[1].priority = 9; nodes[2].priority = 8; nodes[3].priority = 7; nodes[4].priority = 6; nodes[0].next = null; nodes[1].next = null; nodes[2].next = null; nodes[3].next = null; nodes[4].next = null; nodes[0].prev = null; nodes[1].prev = null; nodes[2].prev = null; nodes[3].prev = null; nodes[4].prev = null; head = function(&nodes[0], head); printf("head %p\n", head); printf("priority order!:::::%d\n", head->priority); head = function(&nodes[1], head); printf("priority order!:::::%d\n", head->priority); head = function(&nodes[2], head); printf("priority order!:::::%d\n", head->priority); head = function(&nodes[3], head); printf("priority order!:::::%d\n", head->priority); head = function(&nodes[4], head); printf("priority order!:::::%d\n", head->priority); printnodes(); homecoming 0; }

    output:

    head 0x600c20 priority order!:::::10 segmentation fault (core dumped)

    the segfault caused by:

    if(pos == null){ pos->next = phead;

    you dereference null pointer.

    i have problem next code because of inconsistent variable names (top head , phead next node, etc).

    c pointers types struct typedef

    php - the most accurate way to calucate date periods using the date object -



    php - the most accurate way to calucate date periods using the date object -

    i working on access site, paying members 3 months access period site. issue hence how calculate exact 3 month date period.

    i.e, months 28 days, others 31 days; normal years 365 lunar year 354 days.

    i thinking of converting date unix timestamps , calculating 3 months in seconds. not sure whether efficient , accurate way it.

    below proposal , appreciate advice on it;

    timestamp when clocks starts

    $unixtimestampnow = new \datetime("now"))->format('u')

    calculating 3 months date:

    $numberdaysinmonth = 30.41 = 365/ 12 //number of days in months $numbersecondsinday = 86400; //number seconds in day $secondsin3months = ($numberdaysinmonth * $numbersecondsinday) * 3 //number seconds in 3 months new \datetime("$secondsin3months"); //convert date object

    like said, best came with, suspect not accurate.

    would appropriate advice

    as said in comment, utilize datetime object's add() method dateinterval

    $d = new \datetime("now"); $d->add(new \dateinterval('p3m')); echo $d->format('y-m-d h:i:s');

    php datetime

    Textarea's and syllable counter. [JQuery/Javascript] -



    Textarea's and syllable counter. [JQuery/Javascript] -

    i have 2 text areas;

    textarea #1 contains standard text, textarea #2 contains total syllable count

    they work fine dis-align on line breaks.

    i have feeling snippet of code here contains issue;

    function $count_how_many_syllables($input) { $("[name=set_" + $input + "]").keyup(function () { var lines = $("[name=set_" + $input + "]").val().split(/\n/); var arrayoflines = []; (var i=0; < lines.length; i++) { arrayoflines.push($.trim(lines[i])); } var $content; var $word = 0; var $syllable_count = ""; var $result = ""; (var = 0; < arrayoflines.length; i++) { $content = arrayoflines[i].tolowercase(); word = $content.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '') .replace(/^y/, '') .match(/[aeiouy]/g).length; if ($content.length < 1) { $result = $result + "0\n"; } else { $syllable_count = word.tostring(); $result = $result + $syllable_count + "\n"; } } $("[name=set_" + $input + "_syllable_count]").val($result); // set scrolling $("[name=set_" + $input + "_syllable_count]").scrolltop = $("[name=set_" + $input + "]").scrolltop; $("[name=set_" + $input + "_syllable_count]").scrollleft = $("[name=set_" + $input + "]").scrollleft; }); } setinterval(function ($) { $count_how_many_syllables("a"); },100)(jquery);

    here jsfiddle: http://jsfiddle.net/tq3zzhna/ (type , you'll see issue)

    the problem regex using split lines up. because finding each grouping of lines (i.e. non-line breaks), not taking empty lines 0 characters account. improve approach split line breaks instead, empty lines included:

    this matches optional carriage homecoming , line break: var arrayoflines = $("[name=set_" + $input + "]").val().split(/\r?\n/);

    another issue 1 time fixed checking $content.length < 3 include empty lines. prepare find word count if $content.length > 0.

    lastly can type words no vowels break syllable match (match() returns null), added bit of hack cope it, can better:

    function $count_how_many_syllables($input) { $("[name=set_" + $input + "]").keyup(function () { // split separate lines var arrayoflines = $("[name=set_" + $input + "]").val().split(/\r?\n/); var $content; var $word = 0; var $syllable_count = ""; var $result = ""; (var = 0; < arrayoflines.length; i++) { $content = arrayoflines[i].tolowercase(); var word = $content.length; // if have content, find syllables if($content.length > 0) { word = ($content.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '') .replace(/^y/, '') .match(/[aeiouy]/g) || 'a').length; // handle word no vowels if ($content.length <= 3) { word = 1; } } if (word !== 0) { $syllable_count = word.tostring(); $result = $result + $syllable_count + "\n"; } else { $result = $result + "0 \n"; } } $("[name=set_" + $input + "_syllable_count]").val($result); // set scrolling $("[name=set_" + $input + "_syllable_count]").scrolltop = $("[name=set_" + $input + "]").scrolltop; $("[name=set_" + $input + "_syllable_count]").scrollleft = $("[name=set_" + $input + "]").scrollleft; }); } (function ($) { $count_how_many_syllables("a"); })(jquery);

    http://jsfiddle.net/tq3zzhna/3/

    javascript jquery html css

    php - Rest API (advanced or pro account) -



    php - Rest API (advanced or pro account) -

    i'm working php language. build form , execute direct payment credit card on site. download php sdk library paypal official repo : https://github.com/paypal/rest-api-sdk-php

    for time, create developer business relationship , sandbox environment. in sandbox, utilize "business" business relationship test app , work fine rest api.

    i don't know if paypal advanced business relationship plenty accomplish feature in using rest when i'll go in production mode. know if absolutely have create pro business relationship ? i'm little confused.

    thanks,

    for us accounts if utilize rest api accepting credit cards there no need pro , advanced business relationship . need have business verified business relationship . can check more info here:

    https://developer.paypal.com/webapps/developer/docs/integration/direct/rest_api_payment_country_currency_support/#direct-credit-card-payments

    php paypal

    windows 7 x64 - DirectX won't let me use D3D_DRIVER_TYPE_HARDWARE despite having a DirectX11 capable Graphics adapter -



    windows 7 x64 - DirectX won't let me use D3D_DRIVER_TYPE_HARDWARE despite having a DirectX11 capable Graphics adapter -

    i'd utilize sharpdx rendering engine of wpf project (windows 7, 64 bit, directx10 / 11) i'm running problems getting samples work. can utilize directx 9 samples though. problem not straight related sharpdx since i'm seing similar problems slimdx , other directx samples.

    the directx driver types work when using direct3d 10 / 11 d3d_driver_type_reference , d3d_driver_type_warp. d3d_driver_type_hardware not seem working. not impact sharpdx, c++ samples allow me take between rference , warp drivers.

    my understanding drivertypes simply software rasterizers. implies directx installation not working properly. don't see errors, latest drivers installed , scheme reporting directx 11 drivers , graphics adapter supports directx 11.

    dxdiag not reporting errors dxdiag confirms directx 11 drivers installed i'm using gt 460, should back upwards directx 11 system windows 7 (64bit) / vs2013

    sharpdx able create devices vertexshader created or swapchain set dxgi_not_supported or e_nointerface errors.

    i swapped graphics cards radeon hd 5450 nvidia geforce gt 460 no avail. sharpdx samples run fine on computer windows 7 , intel on board graphics. can give thought going on here? why can utilize warp , reference drivers despite having directx11 capable graphics adapter?

    any help appreciated. references found online such issue running ide within vm did not have proper 3d drivers.

    windows-7-x64 sharpdx direct3d11 direct3d10

    c# - Why do my database commands only work when I interrupt them with MessageBox.Show() calls? -



    c# - Why do my database commands only work when I interrupt them with MessageBox.Show() calls? -

    with next code, first set of database commands carried out fruition (one table dropped, others have record deleted them) if messagebox.show() phone call @ origin of droptablesanddeletefromtables() commented out.

    if uncomment it, user has dismiss after each set of database manipulations (obviously not want in version used customers), - tables dropped, , references them deleted, desired. why interrupting process in way (computus interruptus?) create difference between success , failure, , how can have pie , eat it, (get database commands succeed without bothering user n messagebox.show() dialogs dismiss?

    private void droptablesanddeletefromtables(string recordtype, string filename) { messagebox.show(string.format("in droptablesanddeletefromtables(), recordtype {0}, filename {1}", recordtype, filename)); //todo: remove seek { workfiles wrkfile = new workfiles(); int tableok = 0; dataset workfiles; tableok = wrkfile.isvalidworktable(); if (tableok > 0) //table has @ to the lowest degree 1 record { workfiles = wrkfile.getallrecords(); //go thru dataset , find filename clean after foreach (datarow row in workfiles.tables[0].rows) { string tmptype = row["filetype"].tostring(); if (tmptype.endswith("0") || tmptype.endswith("1")) { tmptype = tmptype.substring(0, 3); } string tmpstr = row["name"].tostring(); int intsite = (int) row["siteno"]; string tmpname = tmptype + "_" + intsite.tostring() + "_" + tmpstr; if (tmptype != recordtype) continue; if (tmpname != filename) continue; //drop worktables table site-specific db [ such hhsdb003.sdf ] string droptable = "drop table " + tmptype + tmpstr; string delworktablesimple = string.format("delete worktables filetype = '{0}' , name = '{1}'", tmptype, tmpstr); string delworktable0 = "delete worktables filetype = '" + tmptype + "0' , name = '" + tmpstr + "'"; string delworktable1 = "delete worktables filetype = '" + tmptype + "1' , name = '" + tmpstr + "'"; // site-specific database first // 0) drop table contents have been sent sendcommandtodb(droptable, intsite, true); pausethatrefreshes(); // 1) delete record site-specific [ hhsdb[sitenum].sdf worktables, such hhsdb003.sdf ] sendcommandtodb(delworktablesimple, intsite, true); pausethatrefreshes(); // bypassing "0" , "1" tables did nil - still drops 1 table , deletes // 2) same 1, table named [dsd,inv}0_bla sendcommandtodb(delworktable0, intsite, true); pausethatrefreshes(); // 3) same 2, table named [dsd,inv}1_bla instead of [dsd,inv}0_bla sendcommandtodb(delworktable1, intsite, true); pausethatrefreshes(); // 4 calls site-specific above; three-four calls non-site-specific below // 4) delete record non-site-specific [ hhsdb[sitenum].sdf worktables, such hhsdb003.sdf ] sendcommandtodb(delworktablesimple, intsite, false); pausethatrefreshes(); // 5) same 1, table named [dsd,inv}0_bla sendcommandtodb(delworktable0, intsite, false); pausethatrefreshes(); // 6) same 2, table named [dsd,inv}1_bla instead of [dsd,inv}0_bla sendcommandtodb(delworktable1, intsite, false); pausethatrefreshes(); // 7) conditionally delete record (if dsd record, dsdheader, in base of operations (non-site-specific) database if (tmptype == "dsd") { string dml = string.format("delete {0}header name = '{1}'", tmptype, tmpstr); sendcommandtodb(dml, intsite, false); } populatetransactionlistboxwithworktables(); return; } // foreach (datarow row in workfiles.tables[0].rows) } // if ( tableok > 0) //table exist //} // lock tfs#4054 } // seek grab (exception ex) { sscs.exceptionhandler(ex, "frmcentral.droptablesanddeletefromtables"); } } // droptablesanddeletefromtables private void pausethatrefreshes() { int j = 0; while (j < 100000) { j++; } } private void sendcommandtodb(string sql, int sitenum, bool sitespecificdb) { seek { if (sitespecificdb) { if (dbconn.inbasedatabase()) { dbconn = dbconnection.getinstance(sitenum.tostring()); } } else { if (!(dbconn.inbasedatabase())) { dbconn = dbconnection.getinstance(); } } dbconn.dbcommand(sql, true); } grab (sqlceexception ee) { . . . } }

    what workaround allow process come air without forcing user play role in charade?

    update

    it seems matter of how much time elapses between each set of database manipulations. when changed this:

    while (i < 100000)

    ... in pausethatrefreshes() this:

    while (i < 10000000)

    (with messagebox.show() commented out) worked! still makes me nervous. there more "scientific" (elegant?) way accomplish this?

    your code illustration both complicated, , incomplete. can't sure what's wrong.

    but symptom classic indication a) running code in question on main gui thread, , b) code @ point winds blocked waiting main gui thread else (i.e. deadlock).

    the right way prepare perform operations on different thread main gui thread. introduce new problems accessing gui elements operation, you'll have address using gui api's "invoke" mechanism.

    c# sql-server-ce compact-framework windows-ce messagebox