Thursday 15 September 2011

iphone - Using self in method call -


When the property / synthesize for UITableView, UIButton, etc. is being used, the method on that variable is included in the call should be there? Using UITableView as an example is the difference between [self.myTableView visibleCells] and [myTableView visibleCells] ? Or [self.myImage setImage: ...] and [myImage setImage: ...] ?

I have seen that Apple code uses the self (bubble level) and the first iPhone development of books that do not use themselves, I want to understand it better, especially since in your UIScrollView method call Using the self has caused irregular / buggy scroll behavior because using self.myTableView is another way of saying

< Div class = "post-text" itemprop = "text" [self myTableView] (This can also be done with [self set MyTableView: ...]; If an assignment is used in the statement) In other words, you are executing a method. Using

myTableView directly accesses the instance variable.

Personally, I usually prefer to use the pre-method because it usually frees me from memory management manually and gives me the benefit of KVO information. However, the additional method is the minuscule overhead of the call, which you may wish to avoid.

Which style you prefer to use, depends on you, and its benefits and disadvantages in every way.


regex - Java regular expression to match _all_ whitespace characters -


I am looking for a regular expression in java that matches all the spaces in the string. "\ S" only matches a few, it's & amp; Nbsp; and similar non-Eski Whitespace I am looking for a regular expression that matches all (normal) white space characters that can be in Java string.

[edit]

To clarify: I do not mean string sequence " & nbsp; " I mean sincle unicode character U + 00A0 That is often represented by "" and ", in HTML, and all other Unicode characters with the same white-space meaving, e.g. In the form of "Narov no-space" (U + 202F), Unicode 3.2 and above, U + 2060 as word adder, "zero Vodate no-space" (U + FeFF) and any other character white. Space

[Answer]

The following expression works for my pupose, i.e. all the blank space characters, Unicode + conventional capture:

[\ P {Z} \ s]

The answer is in the comment below, but since it's a bit hidden I repeat it here.

& amp; Nbsp; Use only one to extract plain text in HTML is white space. And \ s should work properly.


What is the best way to eliminate MS Visual C++ Linker warning : "warning LNK4221"? -


मेरी एक सीपीपी स्रोत फ़ाइल है जो #if / #endif कुछ बिल्डों में पूरी तरह से संकलन करने के लिए हालांकि, यह निम्न चेतावनी उत्पन्न करता है।

  चेतावनी LNK4221: कोई सार्वजनिक प्रतीक नहीं मिला; संग्रह सदस्य दुर्गम हो जाएगा  

मैं एक डमी चर या फ़ंक्शन उत्पन्न करने के लिए एक मैक्रो बनाने के बारे में सोच रहा था जो कि वास्तव में उपयोग नहीं किया जाएगा ताकि यह त्रुटि हट जाए लेकिन मैं यह सुनिश्चित करना चाहता हूं कि यह कई फाइलों में मैक्रो का इस्तेमाल करने जैसी समस्याओं का कारण नहीं देता है, जिससे लिंकर को परिभाषित प्रतीकों पर बम मारना पड़ता है।

इस चेतावनी से छुटकारा पाने का सबसे अच्छा तरीका क्या है (बिना चेतावनी को दबाने के लिंकर कमांड लाइन)?

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

एक अन्य आवश्यकता: हमारे निर्माण विन्यास में से एक एक थोक निर्माण (एकता की तरह) के बाद से फ़िक्स व्यक्तिगत फ़ाइल बिल्ड या एकता निर्माण (सीपीपी फ़ाइल निर्माण को संयोजित) करने में सक्षम होना चाहिए एक एकल मास्टर एकता फ़ाइल की बजाय बल्क फाइलों का निर्माण लेकिन समूह)।

एक अज्ञात नेमस्पेस का प्रयोग करें:

  नामस्थान {char dummy; };  

ऐसे नेमस्पेस के भीतर का प्रतीक बाहरी संबंध है, इसलिए निर्यात तालिका में कुछ होगा। दूसरी ओर, नाम स्थान का नाम ही प्रत्येक अनुवाद इकाई के लिए अलग होगा (आप इसे "बेतरतीब ढंग से तैयार" के रूप में सोच सकते हैं), इसलिए कोई संघर्ष नहीं।


asp.net - Best way to keep track of current online users -


I have a requirement that my site always displays the number of online users currently, for example, "35741 users currently Online "This is not based on login, just how many users are currently on my site I have tried to end the session / session for this, although the end of the session is not reliable so I get the bloated numbers Because my session adds a number, but the session does not end them as it is not a fire.

There is no additional information to collect from this (reporting, etc.), it is only requested that the number shows is a very simple request that is changing in a huge deal. Any help is appreciated

Edit:

I should also specify that I have also tried to use a database for it. A simple table containing session ID and The last activity column is included. With each page hit, I check to see if the session is in my database or not. If not, then insert, if so, update with the time of activity, then I run a process that opens the database in search of a session without any activity in the last 20 minutes. This approach seemed to kill my SQL server and / or IIS. The site had to restart

The best way is to do as you do, but it takes time through activity. If a given session does not reach any page within 5 minutes or more, then you can no longer consider them active.


php - Project conversion from ISO 8859-1 to UTF-8 -


I have coded a PHP project under ISO 8859-1, and for some technical reasons, I under UTF-8 I want to make the project sign. What is a better way to do this? I am afraid of losing special characters such as French letters and scared. Thanks for the advice

You can use shell command by using iconv from Latin 1 (ISO-8859-1) UTF-8

After this, you should make sure that PHP uses UTF-8 as the default encoding (if I am reminded correctly then default_encoding variable in php.ini) If not, Can be set with ini_set () for your project.

After this, you should change your database to UTF-8 or use a Quickfix (for MySQL) like this:

  mysql_query ("SET NAMES 'Utf8');  

For whatever framework you use, you can replace mysql_query () (if you use any one). Place in the primary file that contains all sections and accessories.


In Visual Studio I keep getting two copies of FormMain.cs and one contains old edits, why? -


In Visual Studio 2008, I keep two copies of my FormMain.cs file, it has old edits, I created it again Is the project and solution but it does not fix, what is the problem?

Thanks

Check the file attributes (right-click and properties in Window Explorer Select)

Ensure that you are not setting a read-only flag


wpf listview gridview swaping item template -


I have a list view that is displaying data using gridview. This list is displaying general data of grid views. Too many data displayed in rows and columns However, I have no data to display in columns on some lines. I would like to swap the item template for that line and would like to display another template for the entire row, which will display something like "blank line" or "blank line" for the text and the entire row is the style of different cells Do not Show

I'm trying to use this post :.

Then I have a custom view for the list view. In fact, I've given the sub-class to the Gridview class and on the prepared method method override, I can choose a new template that I want to display for a particular line or default template. However, when I try to choose a new template, gridview will never render it for that line if I use the default template it will still render it. I think the layout for any gridview is interfering with the setting of the template for that line which I want to swap. Is it possible or will I have to create a custom view that mimics the gridview and does not subdivide the gridwish class? Any suggestions or anybody have the experience of this type of scenario, do I want to keep the columns without much work?

You can use DataTriggers, use code like this (some items do not have value of 0 or 0 Depending on, switching templates depending on):

  & gt; DataTemplate x: key = "MyItemTemplate" & gt; & Lt; StackPanel & gt; & Lt; StackPanel name = "normal stackpanel" & gt; & Lt ;! - Template for normal line - & gt; & Lt; / StackPanel & gt; & Lt; StackPanel name = "blank phase port" visibility = "brief" & gt; & Lt ;! - Template for empty line - & gt; & Lt; / StackPanel & gt; & Lt; / StackPanel & gt; & Lt; DataTemplate.Triggers & gt; & Lt; Datatrigger binding = "{some binding object properties}" value = "0" & ​​gt; & Lt; Setter TargetName = "General StackPainel" property = "visibility" value = "abbreviated" /> & Lt; Setter TargetName = "blank stack panel" property = "visibility" value = "visible" /> & Lt; / DataTrigger & gt; & Lt; /DataTemplate.Triggers> & Lt; / DataTemplate & gt;  

Hope it helps.


wpf - Drawing 30fps chart in Windows Forms -


मैं एक विंडोज फॉर्म एप में एक उच्च फ्रेमरेट (30fps +) ग्राफ / चार्ट को आकर्षित करना चाहता हूं।

(मैं जीएनयू की भूमि से आया हूं, इसलिए मैं माफ़ी मांगता हूं अगर यह है स्पष्ट है।)

यदि आप Windows फॉर्म का उपयोग कर रहे हैं (जैसा कि आपके प्रश्न में कहा गया है):

यदि आपको 30 एफपीएस प्राप्त करने की आवश्यकता है, तो आपको शायद एक अलग तकनीक में बदलने की आवश्यकता होगी GDI + ड्राइंग बहुत कुशल नहीं है।

डायरेक्टएक्स इस के लिए अच्छी तरह से काम करेगा। डायरेक्टएक्स का इस्तेमाल करते हुए आप एक विंडो में एम्बेडेड डायरेक्ट 3 डी में चार्टिंग कर सकते हैं। यह सी # से करने का एक अच्छा तरीका है।

ऐसा कहा जा रहा है, आपने इसे WPF के साथ टैग किया है - अगर आप WPF का उपयोग कर रहे हैं, तो सब कुछ मोड ग्राफिक्स बनाए रखा है, इसलिए कोई भी "स्पष्ट-चित्रकारी ड्राइंग नहीं होना चाहिए "आवश्यक आप बस चार्ट तत्वों को आवश्यकतानुसार रखेंगे उस स्थिति में, 30 एफपीएस संभव है।


iphone - Can you create custom build rules for XCode based on file type? -


I have a project with a group of .png files that I want to convert to compressed texture PVRTC. Right now, I am using a custom XCode Run Script Phase which looks like this:

  TEXTURE_TOOL = / developer / platform / iPhoneOS.platform / developer / usr / bin / texturetool $ TEXTURE_TOOL -e PVRTC --bits per pixel 2 -o "$ SRCROOT / images / select_menu_bgs1.pvr" PVR -f "$ SRCROOT / images / select_menu_bgs1.png" $ TEXTURE_TOOL -e PVRTC --bits per pixel-2 - o " $ SRCROOT / images / select_menu_bgs2.pvr "-f PVR" $ SRCROOT / images / select_menu_bgs2.png " 

But this is to clearly include the right list of files Is annoying for They need to be changed (they need to be added in the input and output properties of the build, which is even more painful part.)

What I have to do is make something "easy" with: There is a rule that says, "If there is a PRR in this project, then it is made using PNG to use this command line."

Is such a thing possible in XCode?

Double-click on a target.

Choose rule pane, make it simple with popup rules to target

Click on the plus button at the bottom of the window.

To process: Select Popup, Last Entry - Name Matching Source Files , which allows you to. Use

to enter a file globe pattern, use custom script for select and enter your script below

"$ {INPUT_FILE_BASE} } "For example:

  $ TEXTURE_TOOL -e PVRTC - Beats-per-pixel-2 -o" $ {INPUT_FILE_BASE} .pvr "-f PVR" $ {INPUT_FILE_BASE} .png "  

.net - How to Iterate Through Array in C# Across Multiple Calls -


We have an application where we should de-serial some data from multiple streams into multiple objects.

The data array shows many messages of the variable length packaged together. No code in the stream is deletering

We want to do something like this:

  Zero decode (byte [] data) {Object0.ExtractMessage (data); Object1.ExtractMessage (data); Object2.ExtractMessage (data); ...}  

where each process data call knows where to start in the array. Ideally we do this without giving it in the DataIx context.

To do this, in C ++ we will just keep the hand around an indicator in the array, and each processed function will increase, as necessary

Every object class knows that the stream How to back up the points at the beginning of the next message of how their own messages are serialized and can be trusted (in C ++)

Is there some built-in mechanism in it that we can do ( unsafe without having to do this)? The operation is high frequency (~ 10kps) and very lightweight. We also do not want to copy or trim the array.

Thank you for your help.

Can not you just pass these array indexes? It is basically everything that is an indicator anyway, offset from a certain memory location


design - A good algorithm for generating an order number -


As much as I would like to use GUIDs in my system as a unique identifier, it is user-friendly for a field There is no order number where a customer may have to repeat the customer service rep.

  • To optics)
  • Only numeric values ​​(so it can be easily read in CSR or pressed on the phone)
  • & lt;
  • Answers were posted, we decided to make 9-digit numbers in the middle level saved in DB randomly. In case of any confrontation, we will rebuild a new number.
  • If the middle class can not be checked, the "order number" already exists in the database, the best It could be equivalent to generating a random number. However, if you generate a random number which is limited to less than 1 billion, then you should worry about accidental collision on almost sqrt (1 billion) , that is, some thousand entries After the occurrence of the collision, the risk of content is what happens if the serial number is indexed, but in a disguised manner, i.e. some large number of modules 1 billion next to multi- Will meet the requirements?


    focus - Could it be possible to make css selector affect other elements in the page without javascript? -


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

    • 5 जवाब

    उदाहरण के लिए, मैं चाहता हूं दो टेक्स्ट बॉक्स में एक ही स्टाइल है जब या तो फोकस किया जाता है:

      & lt; div class = "divTxt" & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" id = "a" class = "a" / & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" id = "b" class = "b" / & gt; & Lt; / div & gt;  

    और सीएसएस होगा:

     । A: फोकस (पृष्ठभूमि रंग: ब्लू; } .b: फ़ोकस {पृष्ठभूमि-रंग: पीला; }  

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

    आप कोशिश कर सकते हैं कि इनपुट बक्से एक-दूसरे के बगल में हैं।

    कुछ ऐसा है:

     । A: फ़ोकस {पृष्ठभूमि-रंग: ब्लू;}। A: फ़ोकस ~ .b {background-color: blue;} .b: फ़ोकस {पृष्ठभूमि - रंग: पीला;}। बी: फ़ोकस ~। ए {पृष्ठभूमि रंग: पीला;}  

    नोट: पूरी तरह से अंधेरे में पूरी तरह से अनचाहे और चाकू!

    < / div>

    multithreading - Java - How to know when thread is waiting? -


    There is no clear solution to know if a thread has been placed in the wait position ? I'm putting the thread to wait and I'm going to notification when I need it but sometimes I want to know that a thread is currently waiting, and If so, then I have to do something else.

    I could probably set myself a true / false flag. But I can not imagine that there is a better way to do this?

    method getState () thread.state of a thread < / Code> which can be:

    View new, running, blocked, waiting, time-d-witting or suspended


    excel - Difference of Datetimes -


    In Excel 2007, I want to distinguish the date for the following dates:

      ABC Date 1 Date 2 A and B2 Difference 2009.11.28 01: 25: 46: 0287 2009.11.28 01: 25: 46: 0287? 3 2009.11.28 01: 25: 46: 0443 2009.11.28 01: 25: 46: 0443?  

    Please help me with a formula in Excel 2007 to get the distinction of the above dates.

    Excel stores date 1 = 01/01/1900, since = dates in the form of numbers, So you can just take the difference

      C2 = A2-B2  

    You will give a difference in days.

    If you want it in seconds, for example, then:

      C2 = (A2-B2) * 24 * 60 * 60  

    If you need to parse the string with a fraction of seconds:

      = DATE (center (A1, 4), middle (A2, 6,2), Central (A2, 9, 2)) + TIME (Middle (A2, 12, 2), Mid (A2, 15,2), Mid (A2, 18,2)) + Mid (A2, 21, 4) / (24 * 60 * 60 * 10000)  

    convert A2 to Excel date time. I recommend that you put it in cell D2 and copy it to e2. C2 can then be based on them.


    Weird functioning of Application event in iPhone -


    The iPhone app stops when any call is accepted by the user. When the call ends, the app will resume.

    I have so much I tried, I wanted to capture that event begins when the app after the call ends on applications representatives: - (void) applicationWillTerminate: (UIApplication *) application - (void ) applicationDidFinishLaunching: (UIApplication *) application - (zero) applicationDidBecomeActive: (UIApplication *) application - (minus) applicationWillResignActive: (UIApplication *) application

    visual load: viewDidLoad ViewwillAppear

    But none of the above events can happen. Do not know how I will know that having users back after receiving the call

    A phone The first time an application representative receives an applicationWillResignActive: The message displays incoming call dialogs.

    The user declined the call, the application representative receives a applicationDidBecomeActive message and can resume the application.

    If the user accepts the call, the application representative receives a applicationWillTerminate message and you must prepare the app to stop.

    After the call is completed you can not force the system to restart your app.

    If you can not be called a representative of these methods, the more likely it is that you have a representative has not been specified properly

    It you are not supposed to answer another UIViewController message to your app representatives can make their confused with a view controller with the app delegate to 'Wudidlod. In

    Edit 01:

    On the second reading, it seems that the app would like to resume the state, which before dropping it in response to calls did.

    If so, then not really to trap an event. When an app restarts after a call, it does not get a special event, as it starts when the user launches it. I think what you need to do is save the application status before closing and then reset it to the next time it starts.


    Jquery Bind Event -


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

      $ ('# form_field, #button') .bind ('परिवर्तन क्लिक करें', फ़ंक्शन () {// कार्रवाई करना}};  

    यह ठीक काम करता है हालांकि, जब 'परिवर्तन' का इस्तेमाल '#form_field' और '#' बटन के लिए 'क्लिक' के लिए किया जाता है, तब भी मैं उसी कार्रवाई को ट्रिगर करना चाहता हूं (जब 'क्लिक' का उपयोग '#form_field' के लिए नहीं किया जाता है)।

    मुझे पता है कि निम्न कोड का उपयोग करके किया जा सकता है:

      $ ('# form_field')। बाँध ('परिवर्तन', फ़ंक्शन () {// कार्रवाई करना}}; $ ('# बटन')। बाइंड ('क्लिक', फ़ंक्शन () {// कार्रवाई करना}};  

    हालांकि, मैं फ़ंक्शन के अंदर होने वाले सभी कोड को दोहराना नहीं चाहता (// कार्रवाई करें)। यह अप्रभावी दिखता है और मुझे इसे हर बार दोबारा संपादित करने की आवश्यकता होगी।

    कोई भी विचार?

    पहले से धन्यवाद

    >

    कैसे के बारे में:

      var myCoolFunction = function () {// take action}; $ ('# Form_field')। बाँध ('परिवर्तन', myCoolFunction); $ ('# बटन')। बाइंड करें ('क्लिक', myCoolFunction);  

    ??


    What's the pattern for design-time validation in Workflow Foundation 4.0? -


    How and when should I be valid in custom designs / custom activity factories / custom designers in WF 4.0

    The only place within my activity that provides verification error support, is within the CacheMetadata method (I believe it is often during the design process Is it) Is it validating me? Is there support for verification within the Designer Designer? Yes, your activity has cash metadata where you should do your validation validation is a concept that worksflow runtime. Also applies to the designer. (You can see from this fact that you can still try to run workflow, compiled or declarative, which contains verification errors, but an exception will be thrown when you do.)

    Example :

      Protected Override Zero Cache Metadata (Activity Metadata Metadata) {if (it.bd == 0) metadata.Defination error (new verification error ("You (for a body of this activity Forgot to supply) ", / * iswar Ning = * / true, "body")); }  

    (see)

    Your secondary question is there support to add verification to the activity designer side? The answer is 'no, not really' - it is possible to do some custom WPF and data binding which adds some 'custom verification' above the activity designer, perhaps to define your own activity's characteristics to satisfy its own satisfaction. You can also use AttachedPropertiesService for But this is extra work, and it is not going to tie with the constant order verification, so this is a limited price idea.


    What design should I use so a class can query one of it's ancestors? -


    I am creating an object hierarchy that is representing a table that has to draw on a control. My hierarchy looks like this:

      There are multiple pages in the page Multiple rows in the page There are many cells in the line There are several glyphs near the cell  

    me There should be an option (to display a parameter) on the table to filter the column (cells). Client code can do something like this:

      will display 12 of myTable.ShowColumns (8,12) // columns  

    Control cells by displaying and placing It is the responsibility of objects on the line. Which cell can be displayed in the line object from the table object, how can I pass the information?

    Should I give each row a reference to the table objection? Should I try to pass the information every time through the hierarchy in each row, Table.ShowColumns () is called?

    Should be a great way?

    I do not think design pattern is required (or I would not say it like this) Why not use double links where children are connected to parents and vice versa?


    javascript - jQuery ColorBox confirm override modal dialog? -


    How do I use the 'Confirm override' modal dialog, which is the form until it is clicked on 'Yes' One can subscribe

    one, but I like the implementation and documentation of a lot colorbox, otherwise I'll use the latter.

    I can not help you with the color box, but if you have a specific question or problem So, I can help.


    c++ - How to mitigate class declaration being far from its owner namespace declaration in a file? -


    So, I have seen how useful namespace can be arranged in their respective groups to organize announcements, but now its Comes with an issue.

    The difference between creating a library in C and creating a library in C ++ is in C, so you should do with them related to your announcements, for example, as a library, we dub May be a vector square in Mammoth, the name may well be MM_Vector.

    In C ++, you will have a namespace mammoth that was declared as part of the vector square.

    Now the difference is here in C, just by going to class announcement, how you can use it right away. In C ++, you have to find out what is the location of the name of a particular class (Actually there is only one problem in those files where the declaration is not near the location declaration, which can be normal if the constant and both Between the declared numbers). Although I like to use a namespace for the organization, in my opinion it is still valid argument as annoyance.

    What have people done to reduce this mood?

    MyMath.h

      Namespace Mimuth {class vector; };  

    Vector.h

      # include "MyMath.h" class MyMath :: vector {public: vector (); // ...};  

    Vector. CC

      #include "vector." Mimeoth :: Vector :: Vector () {/ * ... * /}  

    Limiting open namespace - announcement declaration for their content declaration is complete Eligible definitions allow the compiler to capture the typo.

    When applicable to your concern, class announcements and definitions in this style simplify the parent namespace of each category - what people are called


    visual c++ - Can you Hide a virtual method in c++? -


    मेरे पास आभासी फ़ंक्शन के साथ एक बेस क्लास है।

      आभासी CString & amp; फू ();  

    मैं इस तरह उपवर्ग में इसे अधिभार करना चाहता हूं

      CString Foo ();  

    क्या आधार वर्ग वर्चुअल फ़ंक्शन को छुपाने का कोई तरीका है? Vb.net या C # में नए कीवर्ड की तरह कुछ

    क्यों किसी को ऐसा कुछ करना होगा? यह बेस क्लास अनुबंध को तोड़ता है। यदि आप उप-वर्ग को लागू करना नहीं चाहते हैं जिसका आधार क्लास के समान इंटरफ़ेस है, तो आप सभी को क्यों प्राप्त करें? संरचना का उपयोग करें।

    C + नया कीवर्ड में C ++ के बराबर नहीं है यदि आप वास्तव में ऐसा करने के लिए चाहते हैं तो आप हमेशा:

    • एक विधि को ओवरराइड कर सकते हैं उप-वर्ग में निजी के रूप में।

    • अधिभार बनाएं लेकिन अधिभार में अलग-अलग पैरामीटर होनी चाहिए।

    लेकिन अगर आप ऐसा करते हैं, तो आईएमएचओ आपके डिजाइन में कुछ गलत है। मैं चाहता हूं कि प्रत्येक सी + + कंपाइलर को कम से कम इन दोनों स्थितियों को चेतावनी के रूप में पकड़ा गया।


    c++ - Storing variable sized strings in structures -


    I am reading a file in C ++ using currents, in particular, fstream, ifstream no.

      blah blah blah blah blah blah \ n blah blah blah \ n and  

    it repeats and together

    1. In Blah
    2. Continuous continuous rows between each row, finally the delimiter is

    I have to read a set of data, then store it in a character array To do that, I am trying to use getline () in a style style but the delimiter can be only one letter, not B three I obviously can not just try to read a set number of bytes by using the read (), because the number will vary for each set.

    So I think it's the easiest (and most strong) thing to do here. Until I can not find the 'end' string, unless each string is added up and up?

    I tried a 2D four array, but I had a kind of pain copying it. Can I use strncpy here? I do not think this work

      four buffs [10] [10]; Strncpy (buf [1], "blah blah", 10);  

    I have some ideas here, but I'm not sure which one is (or which I do not) is the best.

    Edit: So it is for a networking application, so the size of the four array (or string) should always be the same. In addition, there should be no sign in structure

    Related questions: Is there a way that four arrays and one std :: string are evenly stored in memory? I always had something upper with std :: string though.

    (my utility is described below)

      type type std :: vector & lt; Std :: string & gt; Block; Int main () {namespace std; Of vector & lt; Block & gt; Block; String constant and = "end"; // There is no real difference to use ifstream (btw ("file name", file.in) for file fstream; file;) {block & amp; Block = push_back (block); (String line; for gateline (file, line);) {if (line == end) {break; } Push_back (block) .swap (line); } If (! File & Block. Meta ()) {// Do not read any line, a dummy is not represented in block block. Pop_back (); }} Return 0; }  

    Example serialization:

      template & lt; Class OutIter & gt; Zero bencode_block (block const & block, outISTERST) {int len ​​= 0; (Block :: const_iterator i = block.begin (); i! = Block.end (); ++ i) {len + = i- & gt; Size () + 1; // contains newline} * dest ++ = len; * Dest ++ = ':'; (Block :: const_iterator i = block.begin (); i! = Block.end (); ++ i) {* dest ++ = * i; * Dest ++ = '\ n'; }}  

    I have used a simple serial format. I Example Useful output iterator, which just writes a stream:

      struct WriteStream {std :: ostream & amp; outside; ListStream (Stud :: Ostream and Out): Out (Out) {} ListStream & amp; Operator ++ () {return * this; } ListStream & amp; Operator ++ (int) {return * this; } ListStream & amp; Operator * () {Return * This; } Template & lt; Square T & gt; Zero operator = (T const and value) {Out & lt; & Lt; value; }};  

    Example usage:

      Bencode_blok (block, listStream :: code);  

    Another potential output ister, which writes one (such as a network socket):

      struct WriteFD ​​{int out; WriteFD ​​(Intake Out): Out (Out) {} WriteFD ​​& amp; Operator ++ () {return * this; } WriteFD ​​& amp; Operator ++ (int) {return * this; } WriteFD ​​& amp; Operator * () {Return * This; } Template & lt; Square T & gt; Zero operator = (t const & value) {if (type (value) == -1) {std :: runtime_error (strelror (errno)); }} // Note: The types of writing do not currently write less byte compared to writing int (less value) provided {write back (out, & value, 1); } Write int (std :: string const and value) {write back (out, value.data (), value.size ()); } Int write [four buff [20]; // INT_MAX up to 9999999999999999999 / handle INT_MIN down -999999999999999999 / / that is 19 and 18 nuns, respectively (do you calculate, do not? P) int lane = sprint (buff, "% d", value); Write return (outside, buff, lane); }};  

    Poor man's trick words:

      template & lt; Class C & gt; Type name C: value_type & amp; Push_back (C & container) {container.push_back (typename C :: value_type ()); Return container.back (); }  

    This allows easy access to the transfer words to avoid unnecessary copies:

      container.push_back (value); // copies // becomes: // (the type of container is) container.push_back (C :: value_type ()); // Add empty container. Back (). Swap (value); // swap content  

    visual studio - Python syntax highlighting / Intellisense? -


    I started writing pith with Google App Engine.

    I love the Visual Studio for several reasons, but currently my .p files look like text.

    I have searched the web for a way to highlight python files (Intelligence will be a good bonus, but this is not needed) but nothing is there.

    There are some other questions about this, but the answer in all different IDEs, or IronPythonStudio (which looks more than that, because I just want the color, and it can behave differently Prepare on any .net in any form).

    Does anyone know how to highlight the easy pilot VS? get? Is this really unusual? Thanks for all the responses. I scanned through some Python IDE (and their screenshots): (

    Decided to check Iron Patha Studio. My .p files now get well coded colors, and there is some depth :) Unfortunately Ctrl + K, D does not work, but before that I have plain yellow Compared to code is very good. For anyone who has a huge visual studio fanboy like me, IronPythonStudio is definitely better than coding it as text; O)


    Are there any .NET/ JAVA free or opensource SPAM detectors that yield good results? -

    This summary is not available. Please click here to view the post.

    css - How do I uncollapse a margin? -


    Convergence margins in CSS:

    I understand, but I'm trying to layout, And

    The way CSS explained in the tutorial is either:

    1. Add a border
    2. Add a padding
    3. < / Ol>

      The effects of all these side effects are clear, when you are working with pixel-perfect layout with background images and fixed padding.

      Is there a way to disable fall in the layout without covering the additional pixels? It does not make any sense to influence the document in terms of changing the behavior in any way.

    Well you need something in the middle of the "break" in between.

    My first thought was to use a device with the display: no one is set in the middle, but that does not work.

    So I tried:

      
    div style = "overflow: hidden; height: 0px; width: 0px;" & Gt; & Lt; / Div & gt;

    What is doing well (at least in Firefox, here is not installed here to test Internet Explorer ...)

     < Code> & lt; Html & gt; & Lt; Body & gt; & Lt; Div style = "margin: 100px;" & Gt; & Lt; / Div & gt; & Lt; Div style = "overflow: hidden; height: 0 pixel; width: 0px;" & Gt; & Lt; / Div & gt; & Lt; Div style = "margin: 100px;" & Gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

    parsing - LALR(2) dangling else -


    LLRR (2) is able to swing naturally and handle the matter (with no special rules, as with LALR (1))?

    Thanks

    This is unclear, however, this is not a problem because The well-treated LLRR parser will solve the ambiguity by choosing the change instead of reducing the generator option. This is what you want - "and" to match the previous "if" statement, then the conclusion is: There is no problem, you just have to understand the default choice which the parser generator makes for all the changes - to reduce the ambiguity Do this default can be overridden with some discrepancies, like "rule" or "yacc" with "% exact" operator.
    But this is another advanced topic


    SNMP on AIX 5.3 -


    I need to keep an eye on a system with AX 5.3, but there is no good source for OID. Does anyone know the OID for CPU, memory and hard disk value?

    The best way to find out which OID is you want is the number of tools such as

    However, I think the defaults should be something like this:

    CPU: 1.3.6.1.2.1.25.3.3.1.2.index

    Storage Type: 1.3.6.1.2.1.25.2.3.1.2.index

    Storage size: 1.3.6.1.2.1.25.2.3.1.5.index

    Storage Usage: 1.3.6.1.2.1.25.2.3.1.6.index

    It is also helpful to read RFCs for SNMP ;,

    < / Html>

    asp.net mvc - requireSsl mvc attribute : working with returlUrl -


    There is [needSsl] on my account administrator.

    This only works for all tasks Login action I believe the login process is called follws:

      new {controller = "account",  Return Url = HttpContext.Current.Request.RawUrl} Account / Login? Return URL ... Account / Login% 3freturnUrl ...  

    When changing https as a result of second line in bad request

    Edit: The problem is that "?" The character is changed with "% 3F" I tried to do it with the URL rewire in iis7 and the same thing is the reason why and how to fix it?

    UPDATE: I have got HTTPS to work using IIS rewrite, but not according to MVC as described above. I removed the SSL and did it completely in the IIS. I still want to know why it does not work in MVC

    This is due to the tasks you have described Does not work: The? It is a bug when the character is encoding it should not be done.

    Original EssentialLL Code:

      UriBuilder Builder = New UriBuilder {scheme = "https", host = filterContext.HttpContext.Request.Url.Host, // encoded Goes and should not be included in it? Path = filterContext.HttpContext.Request.RawUrl}; FilterContext.Result = New Redirect Result (Builder.ToString ());  

    Maybe change to something like

      UriBuilder Builder = new UriBuilder {plan = "https", host = filterContext.HttpContext.Request.Url should be done. Host, path = filterContext.HttpContext.Request.Path, query = filterContext.HttpContext.Request.QueryString.ToString ()}; FilterContext.Result = New Redirect Result (Builder.ToString ());  

    regex - Automatic Documentation - Best method for creating a quick parser -


    So I need to edit that end users a great script that requires redundant comment somewhat. I own this

      // ******************** // // // similar files the file name for a includes using script layout: // - function X - is a // - function Y - is something else // // ****************** ** // **** does **************** // function x // (& lt; & lt; I only want one entry in this part Are) // ******** ******************* Code here ... // **************************************** *** // function y // else does // ******************** // code here ...  

    I make a simple parser that makes Examination want header copy / paste the file list function. I am locating several devices that can help in completing it, like ANTLR and even RegEx, but what would be the best way?

    In view of the two options you have given, looking at the ANLR and reggae, I will suggest the ANLR. Aantielar longer will be more flexible, and I believe you should be able to use it effectively (it is based in grammar). Regex approach will be limited to regular languages, as long as you add to some custom logic and whatnot

    As an example, I suspect that you can block the block out of the block with regular expressions Recognize the comments with difficulty. Cfg should be able to fix such distinction. Again, if you have control over the source, then what kind of comments can you draft some characteristics ... ...


    Index value for matrix in R? -


    Is there a function to get the index for the matrix (line number and column number)?

    Say I have a simple matrix:

      a < - For example, the number "23" is an easy way to get something back like C (3, 5) for the matrix (1:50, nero = 5)  

    This works, but I'm sure this is a better way:

    pre> matrix.andx < - Function (a, value) {idx & lt; - which (data.frame (a) == value) col.num & lt; - Roof (idx / nrow (a)) line .Num & lt; - idx - (col.num-1) * nrow (a) return (c (row.num, col.num)) & gt; Matrix.indx (A, 23) [1] 3 5> Matrix. Andx (A, 50) [1] 5 10

    Just seen Help for () after posting and got the answer: arr.ind parameter.

      which (a == 23, arr.ind = true) line Col [1,] 3 5  

    idioms - Setting variables with blocks in ruby -


    I'm able to use a lot of loops in loops, like PHP and when the rest of the language is very clear I Running with code like this:

      conditions_string = '' zips.each_with_index do | Zip, i Terms_string & lt; & Lt; 'Or' if i & gt; 0 terms_string & lt; & Lt; "NAPA =?" End # Now I can do something with some string  

    I think I should be able to do something like this

      conditions_string = zips.each_with_index Do Zip, eye. & Lt; & Lt; 'Or' if i & gt; 0 & lt; & Lt; "NAPA =?"        

    = "Text">

    Are not accessing zip , so the following should work:

    conditions_string = ([npa =? '] * Zips.length) .Join (' OR ')

    If you need access to zip , then you can use it:

      conditions_string = Zips.collect {| ZIP | | 'Npa =?'}. Join ('OR')  

    C++ pass pointer by reference and assign default value -


    I want to pass an indicator with reference to a function, such that I can actually change the address, passing Pointer indicator is

      canceling myFunc (some type * & var = zero);  

    More definition:

      Zero MyClass :: myFunc (SomeType * and var) {if (var! = NULL) (* var) = (* SomeOtherPointer); If (some conditions) var = NULL; }  

    Such a colt can decide whether he wants to call the function with an argument or without argument. And if he decides to pass a logic and holds some condition, then the passed indicator will then point to the tap

    However - if I try to do so, then I It gets:

    Error C2440: 'Default argument': 'Int' can not be explained for 'Type something' and '

    !

    The error message says this: You type a context-to-one-point-to-something Instead of passing an integer what you want to do, you can use a point-to-a-pointer-to-something type:

      Cancel myFunc (some type ** Var = NULL); Zero MyClass :: myFunc (some type ** var) {if (var! = NULL & var! = NULL) (** var) = (* SomeOtherPointer); If (var! = Null & amp; amp; amp; amp; some condition) * var = NULL; }  

    Binding a DataGridView to multiple Tables in DataViewManager or DataSet -


    I have created three data tables by dragging data from a SQL database. I have dt1, dt2, dt3 A data set is added, Meridian has added links between these three tables. I then dragged a datagrid view onto my form and I want to attach three tables to DataGridView. So I added my dataset DS to a DataView manager, MyDVM. I built my DMDM ​​in bindings, binding source1, and made it a data source for DataGrid Weave. I'm not sure how I want to bind table to my DDM / binding source 1, in the DataGrid view.
    I want to display the original table related to the original data in the same datagrid view !!

    Thanks in advance!

    Help me!

    If "display the hair tables" means you display data related to hair tables To do this, you should select your data in the same table using the appropriate completion. DataGridViews display their data in a single-table format - There is no "multiple table" concept in a datagrid view.

    You can help merge detraces with different objects in one.


    c# - Newline in constant -


    जब निम्न कोड चलाया जाता है:

      रिस्पांस। लिखें ("window.open 'BugSummaryForPrint.aspx? PrjId = "+ prjId +" & amp; prjName = "+ prjName', '_ blank'));  

    मुझे यह त्रुटि मिलती है:

      निरंतर में नई लाइन  

    सहायता!

    के रूप में "प्रश्न" की भयावहता, जैसा कि यह है, मैं आज रात सहायक महसूस करता हूं। आपके कोड में जोड़े गए अक्षर ( + ") में आप गुम थे, जब आप prjName जोड़ते हैं।

      रिस्पांस। लिखें ("window.open ('BugSummaryForPrint.aspx? PrjId =" + prjId + "& amp; prjName =" + prjName + "', '_ blank')););  

    jsp for business layer -


    Why should not we use JSP for business layer?

    Is this demonstration? Or is it just a good practice? Absolutely rationality is a reason. Apart from this, is there any killer reason that we should use JSP for the commercial layer?

    itemprop = "text">

    1. Reusability: You can not reuse the scriptlet.
    2. Replacement: You can not make scripts abstract.
    3. O-Capability: You can not use inheritance / structure.
    4. Debugability: If the scriptlet throws exceptions on halfway, you get a blank page.
    5. Test Qualification: The scripts units are not maintenance.
    6. Maintenance: More time is needed to maintain perpetual / annoyance code logic.

    is more, strong> bad behavior

    You can do a lot at the presentation level with it. If you come to a point that it is not possible with any of them and you have been forced to catch skiplets, then code logic finally comes under an real java class. You can use classes to control the class / preprocess / postprocess Vinyl, you can use a class to filter requests, you can use a class for database interaction You can use a class to store / transfer / access data, for business logic, the domain class, a utility class for the stable device You can use.


    asp.net - multithreading in c# -


    I'm new to threading. My boss gave me a scenario. We have a list of objects which is 0f 70gb, we want to load it from the database. It takes time that I want to use a CPU (multi threading) in this scenario. Compared to the second part, when the part of the part is loaded, while the first part is processed, what should I do, what should I do.

    itemprop = "text">

    Do you have control over how the data loads in the database, and how does the hardware look?

    To load 70 GB data, you will be binding I / O for the first time. If the data remains in the same quantity, trying to use multiple threads, the disk head will be beaten because they seek back and backward in the drive.

    This means that your first step should be maximum performance of your disk subsystem. You can restrict the size of your disk partition to the first of the drive

  • Any spindle applied The more you can do in a larger rack:

    1. Using the High Speed ​​Disk Controller
    2. Using Multiple Disk Controllers
    3. The amount of up to the speed of your disk controller
    4. / li>
    5. Your Spread the drive between several controllers

    Once you are in that part, the next step is to divide your data into as much as possible disks and controllers, While still allowing your log file to be self on a volume if you can fill two whole controllers with fast RAID versions, you can split your data between them. In some cases, it can help to use SQL Server's table split mechanism to help with the process and may force parts of the table on some physical versions.

    After partitioning, you

    once you are bound to the previous I / O, then you start thinking about ways to optimize the CPU side You can. Things - but it is quite unusual to go to that point.

    Depending on the speed you need, this type of thing can be complex (and expensive) early ....

    If it helps, I discuss in detail in my book on many issues of facilities.


  • String References in C# -


    This is my first post.

    I am selecting some fields from a database that have numerical ID values ​​such as 10,20,100,110 etc. These numbers are actually something meaningful as the area. Ideally there should be a database table with the database ID and name field, but it is not so and it is now difficult to implement it in the appropriate time frame (politics).

    I currently check to use a bad switch function id and relat text back.

    Private string GetUnitName (string field) {string areaName = string.Empty; Switch (areaid.Trim ()) {case "10": area name = "area 1"; break; Case "20": Area Name = "Area 2"; break; Case "30": Area name = "Region 3"; break; } Return field name; }

    I can not take them at any date time, so what is the best way to store the stars in this area?
    Can I group them in a setting file or something?

    As an enum, you have to compile again if you ever They need to change (depending on how often they change)?

    Alternatively, you may have an XML document that you can hide in the cache and expo to find the text for the ID?

      & lt; Areas & gt; & Lt; Field id = "10" & gt; Region 1 & lt; / Region & gt; & Lt; Field id = "20" & gt; Region 2 & lt; / Region & gt; & Lt; Field id = "30" & gt; Area 3 & lt; / Region & gt; & Lt; / Regions & gt; XPath: / regions / region [@id = '& lt; Your ID is here>]]  

    If the file has changed then set to end the cache dependency, when you update it, you will not restart anything To speed up, you can read it as a hash in memory so that you do not have to keep XPathing all the time at the doctor.


    Regex - If contains '%', can only contain '%20' -


    I want to create a regular expression for the following scenario:

    If a string is a percentage character ( % ) then it can only be the following: % 20 , and can not be preceded by any other '% '.

    So if for example, then % 25 will be rejected. For example, the following string would be valid:

    http://www.test.com/?&Name=My%20Name%20Is%20Vader

    < P> but it will fail:

    http://www.test.com/?&Name=My%20Name%20Is%20VadersAccountant%25

    %% 25

    Any help would be greatly appreciated,

    Kyle


    Edit:

    In short, the scenario is that a link is written in an encoded state and then launched by Javascript. No decoding works, I tried Net decoding and JS decoding, each had the same result - the results remain encoded upon execution.

    % is not required:

      / ^ [^% ] * (% 20 [^%] *) * $ /  

    Is there Any Windows Terminal Service like for Linux? -


    We have some codebars scanners based on Windows CE that run remote applications on some servers through the Windows Terminal Service.

    Given that we are migrating our server applications to Unix based operating systems, I was wondering if a reliable RDP based solution could be considered?

    Thanks,

    VNC is the main Unix option for a graphical session, which That you can run some commands on ssh.


    c# - Adding Control to MDI Client -


    Please help me, I have a problem, I want to know how to add buttons or panel controls such as MDI client please

    If I understand you correctly, you should form a form in the design view in general. And then these forms can be loaded as children in MDI parents.

      // Create a new example form of child form = childform = new form 1 (); // where form1 is a form that you have created // Before making this show, make it a child of this MDI form. ChildForm.MdiParent = This; ChildForm.Text = "Window" + childFormNumber ++; ChildForm.Show (); Take a look at  

    .


    php file_exists() return false on some directory on IIS -


    पर्यावरण:

    1. php5
    2. windows2003
    3. < Li> आईआईएस के साथ fastCGI

    कोड:

      & lt;? Php $ p = "i: \\ tmp"; अगर (file_exists ($ p)) {प्रिंट $ p ' मौजूद!'; } अन्य {प्रिंट $ p ' अस्तित्व में नहीं है!'; }? & Gt;  

    मुझे मिल गया:

    जब उपयोग

    एक मौजूदा निर्देशिका का परीक्षण करने के लिए
      file_exist ()  

    यदि पैरेंट डायरेक्टरी में IUSR_MACHINE की पढ़ने की अनुमति नहीं है, तो परीक्षण हमेशा विफल रहता है।


    c# - inserting with linq -


    I am trying to put a load of data into a table in which the data comes in a name, the ValueCollection key In the form of value for the name and the value as the column,

    I need to convert all the values ​​into their correct datatypes, but there is not a good way to do this, think about it and Then insert the columns' ed table in linq

      transaction DataToint DB = New Transaction DatatyText (); Var column = db Mapping Mapping Source .GetModel (TransactionDataContext) .GetMetaType (Typographic). DataMember; Type T; String type name, colName; Transaction trans = new transaction (); For (int i = 0; i & lt; column; calculation (); i ++) {if (column [i] .name (nvcRequest.Keys)) {colName = columnNames [i] .name; T = columnname [i]. type; Type name = t. Name Toaster (). ToLower (); Switch (typename) {case "int": // convert to value int and add it to a new transaction / but i can not [columns [i]] = new typed value unfortunately .. - what can i do ? break; Convert case "datetime": // datetime and add new transaction brakes to the appropriate field; }}  

    etc ... .. ..

    db.SubmitChanges ();

    The function is in:

    in the public stable boole (this object o, ii amerable c) {foreach (object i in c) {if (i.Equals (o )) If true; } return false; }

    Any ideas? Maybe I should just build a string query? I do not expect: (

    Any help was greatly appreciated

    nat

    Take a look

    Edit:

    Depending on your comment below, if you have transaction object, and one With the values ​​of the word & lt; string, object & gt; and you want to set the properties of the object with values ​​from the dictionary, you can

      Foreach (myTransactionObject.GetType in PropertyInfo myPropertyInfo () .GetProperties ()) {myPropertyInfo.SetValue (myTransacti OnObject, Convert.ChangeType (aPropertyValue, myPropertyInfo.PropertyType), tap);}  

    how validate file size using HTML and Javascript on client side -


    How do I accept file sizes on the client side using Javascript? I am using type = file to select the file

    Update 2013 as the Edit , the file API is supported in all major browsers, and in IE 10 version as

    You If you still want to use the SWFUpload, you still need to support IE9 and below, although at this point it probably should be more of a fallback, because the html5 file app UI supports the mobile platform where SWFUpload can not access.

    Update: Firefox can give its API to this

    you can do this in Firefox

    html:

      & lt; Form action = "method =" get "accept-charset =" utf-8 "& gt; & Lt; Input type = "file" name = "file" value = "" id = "file" & gt; & Lt; P & gt; & Lt; Input type = "submit" value = "continue & rarr;" & Gt; & Lt; / P & gt; & Lt; / Form & gt;  

    Javascript:

      var filesize = document.forms [0]. File.files [0]. File Size  

    If there is a way to do this in IE, then I do not know this. This probably includes active x or some other such nonsense.

    EDIT: I found it in IE,

       

    Javascript Session Data Storage -


    Is anyone a reliable way to store data for use in all pages of the site? I have found so far:

    1. Cookies - I do not have enough capacity to keep an ATM requirement.
    2. URL hash - like the above
    3. Frames - Not a method I'll use ATMs.
    4. HTML 5 document.localStorage and document.sessionStorage - Not yet fully supported
    5. - The site's users will most likely not install it
    6. < Li> - It looks promising ... is anyone having the experience of using it?
    7. - It also looks promising, but when I tried to use the demo and reloaded the page, he lost his input. Did anyone have experience with this plugin?

    Note: I am not an administrator of the site in question, so I do not have the rights to the database, but I am able to add scripting. / P>


    Edit: I found this interesting site that was saved in window.name ... maybe there are some security issues also in this

    Dojo has a nice plugin that uses Flash for local storage. Plus this is why it is abstract, if they have a gear or a html5 browser, then use it instead


    (414) Request-URI Too Large when creating pdf in asp.net -


    After

    I am using the following code (asp.net) to show a PDF for the user:

    < Pre> Answer Contact type = "application / pdf"; Response.AddHeader ("content-displacement", "attachment; filename = the.pdf.pdf"); // data is created with a PDF iTextSharp Response.OutputStream.Write (data, 0, datalength); Rispans.and ();

    Sometimes users receive an error. I have not been able to create this problem, but this is what I have seen in my logs and it always seems like Mozilla 4 or 5 is the problem:

      error message: remote The server sent an error: (414) Request-URI is too large Error Source: System Error Target Site: System.Net.WebResponse GetResponse () Exception Stack Trace: ------------- Bundle error on the System.Web.U.Page.ProcessRequestMain at System.Web.UI.Page (exception e) on System.Web.UI.Page.ProcessRequest (Boolean Include Steshnsafsansikpoint, Boolean include StageAfterAsyncPoint) system. On Web.UI.Page.ProcessRequest (Boolean includes StagesBeforeAsyncPoint, Boolean contains StageAfterAsyncPoint) () on System.Web.UI.Page.ProcessRequestWithNoAssert (HttpContext Reference) on System.Web.UI.Page.ProcessRequest (HttpContext Reference) ASP.my_doexport_aspx.ProcessRequest (HttpContext Reference) on System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () on System.Web.HttpApplication.ExecuteStep (IExecutionStep step, boolean & completedSynchronously) server Variable: ----------------- ALL_HTTP: HTTP_CACHE_CONTROL: A cache HTTP_CONNECTION: Keep-Alive HTTP_ACCEPT: image / gif, image / jpeg, image / pjpeg, image / pjpeg, application / X-Shockwave-Flash, App / vnd.ms-excel, application / vnd.ms-p Pointpoint, application / msword, * / * HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_ACCEPT_LANGUAGE: HTTP_COOKIE: ASP.NET_SessionId = xxxxxxxxxxxxa0jo0pxxxxxx; Kaspsformsdddo = Ksksks436F9868l22C336ClE358DBFBlE908F3767FABAEF5338CF62C785ADD6AEA23F8663B4l3A7C0634DC40F8DCD3Bl0889CB0FB4CEEl86l7FB8BlE87C9655AE69C274AlAD0A5F47D95BF8D502F459D05D09A2B0E369lC6737B679F72C6B0XXXXX; __utma = 213584726.23687335.1259423588.1259423588.1259423588.1; __utmb = 213584726.10.10.1259423588; __utmc = 213584726; __utmz = 213584726.1259423588.1.1.utmcsr = (direct) | Utmccn = (direct) | Utmcmd = (None) HTTP_HOST: www.domain.com HTTP_REFERER: http: //www.domain.com/export.aspx HTTP_USER_AGENT: Mozilla / 4.0 (compatible; MSIE 8.0, Windows NT 5.1, Trident / 4.0; GTB6.3 ; .NET CLR 1.1.4322)  

    I have not found a solution to the problem, do you have any ideas on how to solve it?

    After the

    error message is clear about request-URI . The problem is nothing with your feedback ; What is the URL to generate an error?


    Reliable cube root in Haskell -


    I am doing project over and the following is to check if the number is cube:

      isInt x = x = from the integer (round x) isCube x = is $ x ** (1/3)  

    but due to a floating point error, it returns false results Is:

      * main & gt; IsCube (384 ^ 3) false  

    Is there a way to implement a more reliable cube test?

    On one side-note, this is my other solution, which is the filter (isCube) (perms n) :

      cubes = [n ^ 3 N & lt; - [code] does not work due to a type of interface error [1.]] Perms n = map $ permutations $ show n :: [integer] answer = head [n | N & lt; -cubes, (length $ filter (isCube) (perms n)) == 5]   

    What should I do to fix the error?

      No examples for the floating integer (RealFRC integer) arising from 'iscube' on prob62. HS: 10: 44-49  

    Any customization is also welcome; -)

    Try using the floating point number as much as possible, especially if you have There is a problem that is related to integer values ​​Floating point numbers have problems with the sphere and certain values ​​(like 1/3) can not be perfectly represented, so do not you wonder if you get mysterious answers .

    First of all, in order to correct your typing error, you have to define isCube again. If you check this type of signature then it looks like:

      isCube :: (RealFrac a, Floating A) => A - & gt; Boole  

    Note that it looks like something that is the first argument of class floating . Your problem is that you use this function on integer values And do not have an example of integers floating . You can redefine the isCube to check the function type.

      isCube x = isInt $ (interagral x) ** (1/3)  

    However, this will not be true of your program.

    One way to make your program more correct is to suggest Heinrich. It will look like this:

      isCube x = (round (from integral x ** (1/3)) ^ 3 == x  

    Good luck!


    c# - HTTP POST in .NET doesn't work -


    I have a problem creating a HTTP post request in .NET. When I request that it works in Ruby.

    When I request a request in .NET, I get the following error:

      & lt; H1 & gt; Foxis API Call Failed & lt; / H1> & Lt; P & gt; & Lt; B & gt; Progressed: & lt; / B & gt; Carejobs.carejobs & lt; P & gt; & Lt; B & gt; The method is: & lt; / B & gt; Importvacature / & lt; P & gt; & Lt; B & gt; The parameters are: & lt; / B & gt; & Lt; P & gt; & Lt; P & gt; The criteria are: & lt; / B & gt; Vacax.deelnemernr = 478 & lt; / B & gt; & Lt; P & gt; & Lt; B & gt; GetIDsOfNames failed with error code 80020006: unknown name. & Lt; / P & gt; 

    // www Carejobs.be/scripts/foxisapi.dll/carejobs.carejobs.importvacature ') post_args = {' vaccture.deelnemernr '=>' 478 ', resp, data = net :: HTTP.post_form (url, post_args) Print Print Print Data

    C #:

    Do not you need it? After the url to post a post with parameters? I think Ruby has hidden behind this scene.


    How to read a binary file and display the output as a float in C? -


    I am trying to read a 4-byte number stored in the binary file, but I do not think the correct output here is my code Is:

      #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Int main () {int res; File * file; Float V; // open file file = FOPAN ("pr3 DAT", "RB"); If (! File) {printf ("Unable to open file input." \ N "); } And {res = fread (& amp; v, size (v), 1, file); If (res == - 1) {printf ("Unable to open file input.dat \ n"); } Other {printf ("v =% f \ n", v); }} Return; }  

    My output is v = -961576900.0000000, but it should be v = 3.14159 wherever my problem is?

    NB Input.dat is a binary file: 11010000 00001111 01001001 01000000

    thanks

    Make sure the fread sizeof (float) has the same value, which is the size you are reading. Also make sure your file cursor is in the right place, otherwise use fseek Finally, did your file be written in a large Andian machine? Was it saved correctly? Code seems fine for me.


    templates - OSCommerce - Restructuring productlisting table -


    Do anyone know that to reproduce the product list in OS Commerce (using the STS template) ?

    I think the style output is fine, but because the table (i.e. / td> & lt; / tr & gt; ; ) is automatically created in back-end I

    Surely there should be a way to optimize this?

    Any thoughts?

    The layout of the product listing is actually defined in which / classes / box.php

    Class productListingBox is the one that produces for the table Product Insert Original Table Layout Elements (tr, td etc.) are generated in the expanded orbit table box, so notice that (yes, code and HTML tags mix) it's terrible).

    If you do not want to change the donation table layout, but only to change the information in the table cells, you will find that it is loaded in / module / product_listing.php

    The STS was not installed on the code I saw on PS, so the STS table generates elsewhere ....


    c++ - Matrix the Rectangle Part transpose Cuda -


    I am writing a quadrogram program to change square matrix, based on the size of the idea matrix in two parts is; The size of the matrix is ​​also cut in size with tile, and except for the rectangular part it is transferred separately Ex .: 67x 67 Matrix with tile: 32, the first part is 64x64 transfixed, then the second part is 3x67.

    My problem is in the rectangular section, the first code shows the main code with values ​​defined:

      const int TILE_DIM = 32; Const int BLOCK_ROWS = 8; Integer NUM_REPS = 100; Const int Nx = 2024; // matrix content int ne = 2024 size; Int main (int argc, char ** argv) {const nx = nx; Const int ny = Ny; // arrays are known int int mem_size = nx * ny * sizeof (int); // shape size Saw int * h_idata = (int *) malloc (mem_size); // Basic Host RR Int * d_idata; // device rr checkquuda (cudaMalloc (& amp; d_idata, mem_size)); Dim3 dimGridX (nx / TILE_DIM, 1, 1); // Grid Dimension dim3 dimBlockX (TILE_DIM, 1, 1) used; // Number of threads used / kernel function for rectangular EdgeTransposeX & lt; & Lt; & Lt; Dimgid, dimblock & gt; & Gt; & Gt; (D_idata); CudaEventRecord (startEvent, 0); CudaEventRecord (stopEvent, 0); CudaEventSynchronize (stopEvent); CudaEventElapsedTime (& amp; MS, startEvent, stopEvent); CudaMemcpy (h_idata, d_idata, mem_size, cudaMemcpyDeviceToHost);  

    The kernel code I was advised to use to share, is therefore given below:

      __ global__ zero EdgeTransposeX (int * idata) {Int tile_C [Edge] [nx]; Int tile_v [nx] [edge]; Int x = blockIdx.x * TILE_DIM + threadIdx.x; For (======================= I Tile_V [J] [I-1] = Idata [j * nx + (x + i)]; Tilek [i - 1] [j] = idata [(x + i) * nx + j];} __cintacreds (); (Ent.J = 0; j & lt; nx; j ++) (idat [j * nx + (x + i)] = tilak (for int i = 1; i & lt; = edge + i ++) [I - 1] [j]; adetata [(x + i) * nx + ja = tile_ v [j] [i - 1];}}}  

    the size of the matrix Works fine until reaching 1025, after which the work stops, any thoughts? Why am I missing something here?

    "post-text" itemprop = "text">

    Your two dimensional arrays tile_C and tile_V be stored in the GPU's local memory illegally The amount of the local storage per thread is 512KB Verify that you are not using more than 512KB of local memory per thread.

    Devices , shared The stable qualifier described in this section usually stays in a register, however in some cases the compiler can choose to keep it in local memory, this piece "CUDA C Programming Guide 2015" page 89.

    Mer Suggest that you occupy, use register and visual profiler to see local memory usage.

    This link can be helpful to you:

    I have applied a square matrix transpose using the Kuda Surfaces in 2D, to size it from 2 to 16384 Works fine, increase the power of two If you do not apply a tiled version, then I recommend this approach.


    python - Is there any benefit to using python2.7 multiprocessing to copy files -


    I would like to know that there is no benefit for using Python 2.7's multiprocessing module.

    Does DiskIO always be forced into serial? Is this change if you are copying from a hard disk to a different hard disk? What is this change based on operating system (windows / linux)?

    Perhaps it is possible to read in parallel, but is not possible to write?

    All of this assume that there are separate files that move to different places that are moved / copied to the system cache in the I / O RAM before hitting the hard drive. Fro writes, you can fasten the copies as long as you do not leave the RAM and then slows down and it is faster if many of the same data is read if you copy the same file to several places , Then there is an advantage to making copies of that file before proceeding.

    I / O is a hard drive (or a RAID or volume manager) with a hard drive (joining the group of hard drives) is mostly serial, except that the operating system and drive to search the drive again You can re-order pass / track before reading / writing. There are some advantages to doing parallel copies because there are more opportunities to reorder, but when you are actually writing the system RAM cache shortly after you write your application, it can be difficult to measure profit.

    A big gain is increasing among the drives, they mostly go parallel, although there are some disputes for buses (e.g., PCI, SATA) that drives the drive.

    If you have many files to copy, multiprocessing is a proper way, but you can find that the sub-access is fast for the original per utilities.


    python - Django compressor fails to find any `compress` tags -


    I am trying to implement django-compressor in my project $ Python manage.py compressing works with the following setup:

      & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; {% Load compress%} {% compress js%} & lt; Script type = "text / javascript" src = "{{STATIC_URL}} lib / js / lodash.compat.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "{{STATIC_URL}} Lib / JS / junkie-1.11.1.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "{{STATIC_URL}} Lib / JS / JCOR.JS" & Gt; & Lt; / Script & gt; {% Endcompress%}  

    This works:

      Compression ... done 2 blocks (s) compressed from 21 templates.  

    However, if I add any other templatetag anywhere to that file, it throws an error:

      {% load extra%} & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; {% Load compress%} {% compress js%} & lt; Script type = "text / javascript" src = "{{STATIC_URL}} lib / js / lodash.compat.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "{{STATIC_URL}} Lib / JS / junkie-1.11.1.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "{{STATIC_URL}} Lib / JS / JCOR.JS" & Gt; & Lt; / Script & gt; {% Endcompress%}  

    This error is:

      $ python manage.py compress ... compressor.exceptions.OfflineGenerationError: No 'sec' Template tags found in templates Try running a short command with the --filick-link and / or - extension = extension  

    Why is this error happening? There is nothing with Django-Context in the extra tag template tags.

    According to the source code, when one of your templates has a syntax error, becomes offline generation error . To debug this error, you can see the verbosity & gt; 0 will print this template name which causes an error.

    Hope this syntax can help you debug errors. The last resort of debugging is to use in PDB and checks that why compressor_nodes is empty import PDB; Pdb.set_trace ()


    unicode - Reading a file in python 3.x as Bytes/Strings for PySerial/Xmodem -


    I am trying to read a binary file in a buffer and then transmit it using pyserial / xmodem .

    My test code:

      send_buf = open ('test.py', 'rb') xmInst = XMODEM (self.getc, self.putc) xmInst.send (Send_buf)  

    send xmodem code:

      ... data = stream.read (packet_size) data if not: break / total_packets + = 1 data = Data.ljust (packet_size, self.pad)  

    However, when it executes the last line, then it should be 'a byte string of length 1, not a strap'. Probably a byte / string / unicode problem?

    The xmodem package was written for Python 2.7, so how can I read / pass files in Python 3.4, such as xmodem can work with it?


    rvm - Vagrant - Rails Not Installed -


    I had to destroy and rebuild my horror example recently. Now I can not run any rail order because it says that the rail is not established. I did get the following error

      default: / tmp / vagrant-shell: line when I did  
      ungent  

    1: /home/vagrant/.rvm/scripts/rvm: There is no such file or directory

    The following SSH command responded with a non-zero exit state. Ugarat believes that it means that the command is unsuccessful!

    My Provision.sh file has the following:

      echo "deb http://apt.postgresql.org/pub/ Repos / apt / exact-pgdg main" | Sudo t-a /etc/apt/sources.list.d/pgdg.list sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update sudo apt-get remove PostgreSQL- Client 9.1 PostgreSQL- client-common PostgreSQL- customer PostgreSQL- establishing common -y sudo apt-get PostgreSQL-9.3 PostgreSQL- Client 9.3 libpq- Deva Curl git build -essential libxslt-dev libxml2-dev -y wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | Sh Curl -Saal https://get.rvm.io | Bash-S Stable -Brube Cat & lt; & Lt; EOF | sudo tee -a /home/vagrant/.bashrc CD / stray EOF echo "#" local "Unix domain socket connections only local all all trust # Aipivi 4 local connections: host all all 127.0.0.1/32 trust # Aipivi 6 local connections: Host everyone: 1/128 Trust '| Sudo tee /etc/postgresql/9.3/main/pg_hba.conf echo 'machine api.heroku.com login ***** password **** machine code.heroku.com login ***** password **** * '| Tee /home/vagrant/.netrc Echo 'ssh-rsa ***** vagreg @ precise32' | T /home/vagrant/.ssh/id_*****.pub chmod 0600 /home/vagrant/.netrc sudo -u postgres psql -c "User ***** Createdb make CreateUser password '***** '; "sudo /etc/init.d/postgresql restart  

    I installed rvm while not specific for some answers (Vagrant) suggested that I use as sudo or root Should be done and have seen the need to remove it and then RVM gets it again. I have tried to do this, but I am not sure how this applies to a passionate box and that Mr. As will I get it wrong at the rate that it did not work.

    Do I correct / add my provision.sh file or to my Vagrantfile?

    After the

    Vagrant runs the root file as a root file, then you actually get the form of root until you install rvm you specify otherwise * it was very confusing to me (this will also install things during a novice), I provided and they will "disappear". In fact, they were all set / set as root.

    * Or, when you install rvm manually sshed into the machine, which I will touch more below.

    you su -c "source /home/vagrant/myapp/vagrant/user-config.sh" vagrant using Switch your user

    Do you want to execute any command? In this situation, we are moving a different shell file to user-config.sh which contains all the commands which should not be run as root, such as installing RVM.

    I have a misconception of some concepts too. Every time you delete vagreg your entire virtual machine is destroyed, the hard drive and all. The next time you do vagrant up , everything is rebuilt from scratch. If you have installed and installed things, they will no longer be there.

    This means that all your installation and config provisioning goes into the file, and you should not install things manually after the fact.

    Read once again, I'm hoping that it matters more around this time.


    android - Delphi XE7 Firemonkey TComboBox ListBoxGroupHeader Not Working -


    मेरे Android ऐप में, मैंने कुछ फ़ायरमॉन्कर कॉम्बो बॉक्स सूची आइटम ListBoxGroupHeaders के रूप में,

    हालांकि, रन टाइम पर वे नियमित रूप से listbox की तरह काम करते हैं < कोड> चयन रेडियो बटन।

    मैंने कई कोड सेट करने की कोशिश की है, जैसे selectable को false , और कोई प्रभाव के साथ " listboxgroupheader " के लिए शैली कोई विचार?


    html - How to set Javascript "name" when link is clicked? -


    When I click on the button, it uses a function, I am now trying to make this name more I am "", then entered when

      & lt; Img onclick = "addbeat ()" name = "item 1" src = "button.png" /> & Lt; Script & gt; Function addbeat () {simpleCart.add ({name: "", value: .99}); } & Lt; / Script & gt;  

    Update for

    You have 2 options here. If you are going with an inline event handler, you can pass an event object to your click handler and access the image that clicked by using event.target Such as:

      & lt; Img onclick = "addbeat (event)" name = "item 1" src = "button.png" /> & Lt; Script & gt; Function addbeat (event) {simpleCart.add ({name: event.target.name, value: .99}); } & Lt; / Script & gt;  

    A better option (as discussed in the nearby discussion) will be programmatically attached to your click handler - at that point you will either have to go to event.target or this .

      & lt; Img id = "animage" onclick = "addbeat (event)" name = "item 1" src = "button.png" /> & Lt; Script & gt; Function addbeat () {simpleCart.add ({name: this.name, price: .99}); } Document.getElementById ('anImage'). Onclick = addbeat; & Lt; / Script & gt;  

    csv - VBA Importing long file names -


    One on my desktop The Csv file is I. The file name is too long and includes special characters such as brackets like:

      [abcd 012015] accent 1117 - section a10 grade-20150316_1 937-comma_sepated csv  is 

    where filename is the first 36 characters would change every instance of downloads remaining constant file name I file to try VBA to import access with a Dusimdi. Transfertext and I get errors I have come to know that there is a limitation of the file name that can handle DoCmd.TransfertText , so, I need to manually rename the file, then I will use VBA I can use. Changing the file name is relatively easy with VBA, but I would like to use the information provided in the original file name such as Section A10 (which makes it unique because other streams are labeled A01, A02, etc.) and name Replace. The CSV file is named as A10.csv, so it means that searching the string and changing it. Since the segment can be different, how do I write the code and rename the file, then import it with VBA? So, I still have bits and pieces but can not keep them together:

      NewPathName DoCmd.TransferText acImport, "AME_Grades", strTable, strPathFile, blnHasFieldNames as the name OldPathName < / Code> 

    Am I using Access Tabulation AME_Grades Any suggestions for making it cleaner in the Access Table? TS

    I recommend using it before importing the data from the CSV file in MS Access.

      as dim as string, NewPath name string, old designation = "Fulpath Tovervir freakish Langfailnam. Csv" Nupathanam = "Fulpathtourfailnam. Csv" Failkapi vintage old name, Nupathanapeedimdi. Transfer Text AIMport, "AME Grade", Stableable, Nupath, Blanhasfelden  

    ios - Scroll long text inside WKInterfaceLabel? -


    Simple question: if its text is too long, then there is a way to scroll WKInterfaceLabel Fit within the frame? UITextView ? You can certainly do something with

    . You only need to set the following properties on the WKInterfaceLabel in the storyboard.

    • Label => lines = 0 (Watchchit
    • Size => Height = "Size
    • Size => width = "Container-related" To Fit Content "

    This will allow you to scroll through the contents of your heart. It has velvaged it in the sample app and it actually works as you expect.

    Hope that helps!


    docker - dockerfile: vim (compiled python), vim-ipython, and ipython notebook -


    I want to create a dokterfile in Linux which is 1. Pixes with Ajax 2. 2. Installing Python Stack (eg numpy, scipy, ipython, etc.)
    creates SSL certificates for ipython-notebook, to see notebook on host machine

    It seemed quite straightforward but I Despite various methods, I ran into problems like adding different containers, using anaconda. L creating single-layer image, or run all as a user by root.

    To run the VIM, simply by installing to root, the pathogen does not activate bundle / vim-ipython . To set up a user , the pathgenation allows bundles (i.e., do not work), but : IPython throws an error.

    : IPython failed ^ - failed "not found" . Ive tried any layers above / 1 with large Dockerfile, and notebooks with different layers for python stack, vim, and ipython.

    What am I not seeing here? Referencing ^ - failed '' not found '? Ive removed the ipython notebook for - no-browser & amp; Tried to run using and then vim is running, or tried to use two shells running on the same container ... but this error could not be retrieved.

    This is a job for anybody trying to work in vim-ipython in Docker.

    Issues:

    1. Regardless of the need, user / shared house is needed, although in the patient / bundle
    with the container Running in the root form is not sure why weam need to install the package, but USER CMD

    - The best

    will throw errors with

    subtracting data from columns in bash csv -


    I have several columns in one file, I want to subtract two columns ...

    This form ... without a decimal ....

      1.000 900 1.012 1.010 1.015 1.005 1.020 1.010  

    Let me count one more file in the same file Column is required

      100 2 10 10  

    I have tried

      awk - F "," $ $ 16 = $ 4- $ 2; Print $ 1 "," $ 2 "," $ 3 "," $ 4 "," $ 5 "," $ 6} ' 

    but it gives me ... < / P>

      0.100 0.002 0.010 0.010  

    Any sign?

    Use this awk :

     < Code> awk -v OFS = '\ t' '{p = $ 1; Q = $ 2; Sub (/ /., "", P); Sub (/ /. / "," ", Q); Print $ 0, (p-Q)} 'file 1.000 900 100 1.012 1.010 2 1.015 1.005 10 1.020 1.010 10  

    javascript - Toggable tabs in an AngularJS single page application? -


    I have an application running This is a single page application using AngularJS 'hashtag routing.

    I want to apply an objectable tab, but they use hashtags to switch tabs (like www.example.com / # tab1 to work on them) and www.example.com/#tab2 ). All ok and banda, except that I can not use that kind of hashtag due to fingerprints routing, what is the solution to create working tabs in an AngieS single page application environment?

    Thanks in advance, I will accept the answer that helps me solve it.

    The fact is that you are using AngularJS routes to use the AngularJS version of the Bootstrap tab Should not be stopped from.

    See the following link.


    javascript - Using History.js back button doesn't work? -


    I'm using history.js from here

    It's currently in my:

      var history = window. History; If (history.enabled) // // is the initial position for the first page that var state = history .getState (); History.pushState ({urlPath: window.location.pathname}, $ ("title"). Text (), State. Arlpath); } Other {return false; } // Content Update and Back / Forward Button Handler History.Adapter.bind (window, 'static', function) (var s = History.getState (); History.log (s.data, s.title, s Url) ; // update type load type onLoadPageByURL (s.data.urlPath);}); // Navigation Link handler $ ('body'). ('Click', 'a', function (e) {e.prevent default (); var load = $ (e.currentTarget) .data ('load'); var urlpath = $ (this) .attr (' Href '); var title = $ (this) .text (); History.pushState ({load: load, urlPath: urlPath}, title, urlPath);});  

    It seems that everything should work, but the back button is not working properly? What am I doing wrong?


    excel - Copying cell values from one Workbook into another -


    I have the following code that I've written for taking a few names and used them to populate tilesheets.

      sub initNames () Dim I as integer I = 0 as the dim name string Windows ("employee data .xlsx"). Active sheet ("employee"). Choose Range ("A2"). IsEmpty (ActiveCell) name = ActiveCell.Value workbooks ("Timesheets"). Sheet ("ST"). Range ("A9") Offset (i * 9) .Volume = Name ActiveCell.Offset (1, 0). Select loop and sub  

    Basically, the cells present in the target sheet remove 9 rows from each other, hence the first name is in cell A9, second in A18, in A7 Third, and so on. I'm sure I have some incredibly simple, but I have not received any response from Excel (no error message). The cells in the Timesheet are merged cells, but I can not change them (locked by the owner), but I do not think there is anything to do with it.

    Edit : I've added a line: basicvalue = workbooks ("Timesheets") Sheets ("ST"). Range ("A10") Offset ((x - 2) * 9, 0). So I could see what values ​​were being overwritten in my timesheets and I have seen some interesting things: the original cell should only be before the text of the cell (A9) After that, each cell captures (A18, A27, etc.). ) Debugger indicates that OriginalValue = "" Although there are names in these cells, however, when I open another worksheet and reference A9, A18, etc., I am taking the name.

    Edit 2 : I modified the test line to read the workbook ("Timesheets"). Sheets ("ST"). Range ("A" & ((X - 1 * 9)). Value = "test" which does change the values ​​in all target cells. Why VBA allow me to allocate "test" to a cell value, but why not name it in other worksheet?

    "post-text" itemprop = "text">

    Try something like this, it will complete the task that you are requesting without using . Choose or . Activate

      Sub InitNames () Dim I as Integer Dim Wksht as Worksheet i = 0 Set Wksht = Workbooks ("employee data.clicks"). Wksht.Range ("A" and "Wksht.Rows.Count") for Sheet ("Employee") I = 2. End (xlUp) .row workbook ("Timesheets") Sheets ("ST"). Range ("A9") Offset ((i-2) * 9.0) Value = Wacchat Category ("A" and "I"). Value next i sub subdomain  
    ends

    eclipse - Simple java game ,problems with creating a timer -


    I am making a simple game where you control a ball and you can Avoid

    The idea is that there will be a timer, which will start from 0 and after about 10 seconds, it is going to move along with the moving obstacles to the second level

    I have some problems in creating a timer, which will start counting, I tried to:

      Abstract Vjnik static void Timer () {int count = 0; While (count & lt; 10) {try {thread.sleep (1000); } Hold (exception e) {} calculation ++; } System.out.println (count);}}  

    The timer starts, but for some reason, the program is not like the "Thread Sleep" part, and all the graphics discovers JFrame . The game is still running behind, maybe there might be a better way to do this?

    Update: My class is down for the game without my timer: P

      Expands the public class game; JPNL Action Lustner (Timer Main T; User User; Int ostensible = 5; Int levelnumber = 1; Stable Array list & quot; Obstacles & quot; barriers = new arrelist & lt; barriers & gt; (); random rand = new random (); public game () {setFocusable (true ); User = new user (270,250); AddKeyListener (new key (users) Gator); MainT = new timer (10, this); mainT.start (); for game start (); (int i = 0; i & lt; barriers; i ++) {addObstacles (new barriers NXTIN (600), RAND.NXITIN (600));}} Public Zero Color (Graphics G) {// Paint Method Superpant (G); Graphics 2DG2D = (Graphics 2D) G; user For obstacles for draw (G2D); // (int i = 0; i & lt; barriers.) (I ++) {barriers interrupted = obstructions (I); obst.draw (G2D);}} Public Zero Methodology (ActionEvent arg0) {// Action Listener user.update (); (Brick e = 0; E & lt; Obstacles. Size (); I ++) {obstructions obstructed = obstacles .get (i); Obst.update (); } Color (); } Public Zero addObstacles (Obstacles ob) {obstacles.add (ob); } Public Fixed Arrestist & lt; Obstacles & gt; GetObstacles () {Return Obstacles; } Public stable zero gameover () {System.out.println ("Game over!"); System.exit (0); } Public Zero startgame () {barriers = levelnumber * 1; (Int i = 0; i & lt; barriers; i ++) {addObstacles (new barriers (RAND.NETXTIN (100), RAND.NXITIN (600)); }}}}  

    Yes, you can add a flag variable to your timer function . If you're just trying to delay the action of something, then try to do something like this in your action for the timer

      if (counter! = 0) {counter ++; If (counter == 10) {// count to 10ms counter = 1; // whatever you want to do after the delay}} and {counter = 0; }  

    java - Android: This imageView is not found? -


    I am loading a bitmap from the input stream and putting it on an image view. So I have a button which should draw a circle on bitmap. The error is that imageview (which is called 'touch') is not found inside onClickListener ... how can I fix it? When I press the button, then nothing happens. (Note: Zoom Injhumot square, is an extension of Imejyuwu)

      to try {java.io.FileInputStream = this.openFileInput (path); Bitmap bitmap = bitmapfenderDecodedStream (in); Find ZoomInZoomOut Touch = (Zoom InZoom) VVBIID (RID. IMJIIDID); Touch = arrangeImageView (touch); Touch.setImageBitmap (bitmap); In.close (); Draw Button = (Button) Find ViewById (R.id.draw); draw.setOnClickListener (New View.OnClickListener () {public void onClick (View v) {bitmap imageBitmap = Bitmap.createBitmap (200, 200, Bitmap.Config.ARGB_8888); canvas = new Canvas (imageBitmap); painted p = new Paint (); p.setAntiAlias ​​(true); p.setColor (Color.BLUE); canvas.drawCircle (60, 50, 25, P); /////////////// // ///// Error is on the next line: touch.setImageBitmap (imageBitmap);}}); } Hold (exception e) {e.printStackTrace (); }  

    Here is XML:

      & lt; RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: device = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / activity_horizontal_margin" Android: paddingTop = "@ Dimen / activity_vertical_margin" Android: paddingBottom = "@ Dimen / activity_vertical_margin" Android: background = "@ drawable / Background "tool: reference =" com.commonsware.android.test1.ImageDisplayActivity "& gt; & Lt; Com: com.commonsware.android.test1.ZoomInZoomOut Android: id = "@ + id / IMAGEID" Android: layout_width = "match_parent" android: layout_height = "match_parent" android: layout_alignParentTop = "true" Android: layout_alignParentLeft = "true" Android: Layout_alignParentStart = "true" /> Android: Layout_height = "Wrap_content" android: text = "O" android: id = "@ + id / Draw" Android: Leaut_aling ParentBottom = "Android buttons" true "Android: Leaut_liinprarthlft =" true "Android: Leaut_algin Parentstart =" True "/>  

    touch variable one If you want more explanation, then check it out.

    In order to correct your problem, Change your code:

      Last zoom in Jhumot touch = (zoom Injhumot) Dundenwubiaiaidi (R.id.IMAGEID);  

    or < / Strong> You can also create a variable in your class if you can get it later from the second scope:

      touch the private zoom inzoomout;  

    and thus illustration:

      touch = (ZoomInZoomOut) findViewById (R.id.IMAGEID);  

    python - Parsing badly formed XML with BeautifulSoup without converting tags -


    Beautiful soup is very good to fix badly created XML:

      & lt; draw: image xlink: href =" image / image .png "xlink: type =" simple "xlink: show =" embed "xlink: actuate =" onLoad "/>  

    This gives me:

      & lt; image actuate = "onLoad" href = "picture / Image Png "show =" embed "type =" simple "/>  

    I want to keep it raw! Should not be too smart to tell the person?

    After seeing the entire document properly, I saw That some namespace definitions were no longer present. After adding them, the desired behavior was over.