Posts

Showing posts from January, 2010

java - Sending a Text Box control to the Printer? -

I can find out to send a text box control to print in Java. The program word search creates puzzles, now I want to print them. I just want to print the text box control as it is ... but I had to try other methods like this. My first problem is that when I try to send it to txtEasy.getText () it actually tries to print a long string. I did not want this, so I really wanted to take a long string and parsize it like this. Rows of 15 words from 20 Unfortunately you can not see here But this is a box from 15 to 20. MSN I T i SO P M O CLG D RB P UDC K S K GUBE I Q C D I N M. P P I UNPJ J U tnl i ncvd qbw i uu t ot ntf j ond ngtglgbrk cmm msw ghtasnn i gi u K XU X SEP I E QCTGCBO XHJNBDTTJP I think I am an AQQ ECSW I FOLM M NRT I am an ELPSPD Q O UU A P EHF I TSOF QNLLLLHDOQFAO AG TQA BS ASRWTCLTNPGNESTXTYPOVT I EWL QCF I HSEJFEMLADDNAEEN W K T QN I I K I J V S I G F & H E E P Y Y Jammu US H R D FVDRD I BEFRR I U.HUYE VSFOE Q JAMMU V RN V V RG RLG Q SBM FGA J This is my code

algorithm - Alpha Beta Searching and Transposition Tables -

I have alpha beta search and want to apply transpization table to make it faster i am having problems In that table the entries and current status are being evaluated. The literature I have read so far is to tell you how to store the status type, score, and some other information? Can not you use the score only until the entry in the table is more deeply recorded than the previous search? Shows some sample code to do this, but I have not figured out that AB search returns beta when alpha> = beta will not return alpha to you? If your hash function can produce conflicts, then you can store the situation. To make sure that the score is from a deep search, you will also need to store the position depth. And of course, you have to store the score. For your second question ... which is known as beta cutoff, the base is that your opponent has already found a better line for himself in search and that digit is beta (negatives) Alpha, as beta for you) has been started ... When

php - Getting Doctrine to use MySQL "FORCE INDEX" -

I have a query in the doctor's DQL, which would greatly reduce the MySQL's "Force Index" functionality Question time below is a question that basically looks like in plain SQL: select from the item ID for the Forward Index (best_selling_ads) WHERE price = ... (etc ) LIMIT 200; I think I would have to expand some principle components to be able to do this with DQL (or in a way, to include SQL in one of the doctoral questions Any way?) Anyone have any ideas? Thank you! I have found very useful Doctrine_RawSql examples are online, so here is my query to create For what am i doing $ q = new Doctrine_RawSql (); $ Q- & gt; Select ('Table 1B Force Index' (Best_celling_idx) INNER join table 2c on BC Deid = C.id '(' {b.id}, {b.description}, {c.description} ') -> ) - & gt; Ed Comant ('B', 'Table 1B') - & gt; Ed Comant ('C', 'BTB 2C');

android - Parse XML string using SAX -

Is there a way to parse XML string using Android SAX? class MyXmlContentHandler extends the default handler {... // apply SAX callback here} Then you can use the utility class: Xml.parse (xmlString, New MyXmlContentHandler ());

database - Django: several tables for one model. -

I have a model "message" that I use to store messages on the site. These are messages in discussions, private messages and maybe chat. They are all stored in a table. I wonder if I broadcast messages between multiple models and tables, then it will be faster. One for chat, one for discussions and so on Should I put all the messages in one table / model or make many similar models / tables? Unless you have an index on your type column and on that Filter, it will be about the same speed when your table really gets bigger, then just the blur on the type column and it will be similar to the display of multiple tables, but your app Only a large table will see.

winapi - Getting user input from Win32 C++. WPARAM casted as int? -

I am working on a pre-existing codebase and I follow any 1-2 digits of user type When entering the code at any time by entering the key and passing that number to a function. At present, user input is controlled in such a way: LRESULT callback WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {int wmId, wmEvent; Switch (Message) {Case WM_KEYDOWN: Engine :: GetInstance () - & gt; GetInput () - & gt; GetKeyboard () - & gt; Setcased (static_cast & lt; int & gt; (wParam)); break; // Content Now, I do not know about some things, a) Why pass cubes as an integer Will instead be a character? b) In this case what will be the "F1" sent c) How can I do this? Use it to read in the 1-2 digit number and only when the entry is entered? a) The value sent here is a virtual-key code, required Not a letter b) See the list of virtual key codes (given in a comment) F1 will be represented by VK_F1 (0x70). c) When a number is pressed,

How to add a button dynamically in Android? -

Android में गतिशील रूप से एक बटन कैसे जोड़ें? बटन myButton = नया बटन (यह); MyButton.setText ("मुझे पुश करें"); LinearLayout ll = (LinearLayout) findViewById (R.id.buttonlayout); लेआउटपरम एलपी = नया लेआउटप्रर्म (लेआउट पैरामा.एमएटीएचपीएआरएनआरटी, लेआउटप्रैम। WRAP_CONTENT); Ll.addView (myButton, एलपी); उदाहरण के लिए एक नज़र डालें

c - Algorithm to find the duplicate numbers in an array ---Fastest Way -

I need the fastest and simplest algorithm that finds duplicate numbers in an array, should also know the number of duplicates. Example: If the array is {2,3,4,5,2,4,6,2,4,7,3,8,2} I should know that there are four 2, two 3 and three 4. Create a hash table where the key is the array object and the value is how often the array array related to the array has come. To do this, this is an effective way, but probably is not the fastest way. Something like this (in pseudo code) Array for item in ifh_map = create_new_hash_map ()

How to calculate decimal and hex values of one and two's complmement binary representation? -

For example, consider an initial value of: 0100 0011 What is this in hex and what is this in decimal, if two supplements have to be used? Similarly, what is hex and decimal if using a supplement of someone? More generally, how do you work the hex and decimal values ​​of both forms of binary representation? Hex is easy, just separate in 4 bit groups and convert each group to decimal. Then, obviously, 10 with A, 11 with A, 12 with C, 13 with D, with the representation of E and 15F hex, usually does not care about one or two supplements And just reflect the bits exactly. To change the form of decimals: Depending on the complement of one or two, do the job that the signal and the full value will be. If the first bit is 0, then it is positive, if it is negative of 1. Positive values ​​do not require any further modification. The absolute value of a negative value depends on whether it is complementary to one or two. The complement of one is only negative bits (0 becomes

Git Version numbering with a centralized workflow -

We are using GIT with a central server, and our code needs to include the version number in the file . The way this is currently done is: A new developer does "cluster GIT" In his local copy, he makes edits. Committed to call Git / Hook / Pre-Version.sh version.sh (which is included in the project root) takes a version number from "git description" And stores it in a file. Although this works, I would like to make sure that the version number is updated, even if a developer forgot to edit its pre-committed hook. Since there is no working copy in the server, just (pre-post) - no hook works, so I am thinking that there is a way to do this. / P> #! / Bin / bash refname = "$ 1" oldrev = "$ 2" newrev = "$ 3" if [-z "$ refname" -o -z "$ oldrev" -o -z "$ newrev"]; Then echo "usage: $ 0 gt; oldrev & gt; & lt; newrev & gt; & Gt; And 2 exit 1fi if ["$

Facebook Comments Count -

I am trying to write a Facebook query that will return all the comments posted by the user to his friends, However, I can not seem to find the right schema, there is no 'indexable' field to create it. Any suggestions please? Wineshtain with the help of the stream comments The indirect path would be something like this select * from comments where fromid = & lt; My_id & gt; And in the object_id (where post_id is in the source in the stream (choose UID1 from friend, where UID2 = )) for photographs, for middle queries Options Select from pid where in the Help (Choose Help album WHERE owner ... (<... Unfortunately security settings are not available in your Friends can restrict wall posting and pictures inquiries. / P>

linking models ruby on rails -

I have 3 models: users, vendors and cars I want the users to choose A car and it is added to the user's shopping list. I have something in the car controller like this: @user = User.find (params [: user]) @ cellar = vendor.fund (paraam [: vendor ]) @ Car = @ user.car.build (param [: car]) but the seller is not added. How can I do this? BTW I have this: class car < in my model for the car: @ Car.seller = @seller after making the car, then do not know about @ car.save build @ cellar, you need to tell the car That he has a vendor, it really only knows that there is a user because you have created a car from the user. You can also do this: @car = Car.new @ car.Sellar = @celler@car.user = @user >

symfony1 - Best Step by Step tutorial for Symfony - (I am running PHP on Windows) -

I have tried to follow the symphony tutorial: This is incompatible: downloading this sandbox But the rest of the tutorial seems to be for a non-sandbox version. It seems that there is not one step by step and I can not get the same result. This is really disappointing and if I do not have a project on it, then I will give it already! So is there anything better than official tut that I can just start? Thank you very much. Symfony is the best PHP framework currently available at this time. symphony documentation It has a large amount of functionality and a large and active community. To help you get started, the creators have provided one. The document for the latest version is here 1.4: Getting started can be the first port of the tutorial call: / P> In the earlier versions of Symphony, some of the best step-by-step tutorials are about how to create a full web application: V1.0: Askeet - v1.2: jabate - Symphony has a great learning curve, B

xcode - Creating Help Files - Applescript Studio -

I would like to know how to generate help files for an applescript studio application I'm currently making several different - Have tried different options, and have goggle it for some time and no answer is available. When I click on the menu item "App Help" in my application, it opens the help viewer together when I try to make help the blank window. I am currently running a tiger with Xcode 2.4.1 I Used for many projects and never got a problem

.net - Interop assembly pointer length -

Why ever changes the SAM pointer parameters in Visual Studio COM libraries to uint Ever Ulong ? I have a com library where there are some ways like parameters, such as [in] ULONG_PTR When I use this library on my desktop computer Let me render the interop assembly change ULONG_PTR to uint . When I do this on my laptop, it is converted to UlhoneG . Problems arise when sharing projects between machines, I may store interop assemblies in SVN with other projects, but for example, after updating the COM library, I need to reproduce it again. . The system is: Desktop laptop - Windows Vista Professional 64-bit - Windows 7 Ultimate 64-bit - Visual Studio 2008 Professional - Visual Studio 2008 Team System (SP1) Development Edition (SP1) - Net Framework 3.5 SP1 - Net Framework 3.5 SP1 The UAC is enabled and the Visual Studio is run as an administrator. I will try to apply the Visual Studio 2008 SP1 on the laptop, if it has any effect. Edit: No effect on the installed S

Best practices for Silverlight usage in a ASP.NET MVC application -

What are the best practices for using ASP.NET MVC and Silverlight in the web application? Which libraries / frameworks (eg prism) should be used to make the application unit tested and fast? How to pass data to a portion of silver from ASP.NET MVC (if possible, binding) and sub-poem (asp.net to silverlight)? The unit framework with RIA services is done properly for this purpose.

wpf treeview mvvm -

I am trying to populate a treeview using mvvm, but the tree does not display any data I have an employee list which is a property in my VM that includes employee data. I Xaml is as follows. Style Target Type = "{x: Type Tree VIIIIT}" & gt; & Lt; Setter property = "fontwhite" value = "normal" /> & Lt; / Style & gt; & Lt; /TreeView.ItemContainerStyle> & Lt; TreeView.ItemTemplate & gt; & Lt; Hierarchical data items source = "{binding empList}" & gt; & Lt; Text block text = "{binding empName}" /> & Lt; / HierarchicalDataTemplate & gt; & Lt; /TreeView.ItemTemplate> & Lt; / TreeView & gt; Am I missing anything thanks

xml - Creating Database in ActionScript -

I am starting AS3 and I would like to create an XML file that does not use PHP through the AS3 program Data can be saved from / P> Check out they work continuously like local storage - a "flash cookie."

wordpress - rewite rule for two folders -

I'm migrating my web from Joomla to WordPress, to do this I need to install the new subfolder Wp There is an HTACAC file that needs to be converted to subdirectory / Joomla / Jootla app. I / joomla / directory requires / wp / to set up and test before deletion actual htaccess: & lt; Files php.ini & gt; Allow orders, from all & lt; / Files & gt; Rewrite% {http_host} ^ myweb.info rewriterule ^ (. *) $ Http://www.myweb.info/$1 [r = 301, nc] option ## www.myweb.info joomla hack # on slash RewriteCond% {HTTP_HOST} ^ (www \.)? Www.myweb. Info $ [NC] Rewind Conduit% {DOCUMENT_ROOT} / Joomla% {REQUEST_URI} / -d Revisited [^ /] $% {REQUEST_URI} / [R = 301, L] Subdomains for # Domains RewriteCond% {ENV: REDIRECT_STATUS} } ^ $ RewriteCond% {HTTP_HOST} ^ (www \.)? Www.myweb. INFO $ [NC] Rewrite Rules ^ (. *) $ / Joomla / $ 1 [QSA, L] # No Directory Listing & Browsing Index IGOROR * / * Option ALL-EXDEX # and deny directory listing I think the index is to be ignore

java - algorithm for getting time zone from geo coordinates -

I want to write an app where users can point to any location on the map (not only cities) and in that place You can get timezone. / P> What data structure (the app will not have internet connectivity) and algorithm should be used? Where can I get the required data (I am more vigilant after dividing the map in 24 rectangles)? I will write my app in Java. Given that time zones are based only on physical entities rather than calculating physical latitude / lawn, I will create a data structure that coordinates more latitudes / lawn political entities (country and province / state) than matraged polygons, and then there is a separate structure in which political institutions and current dates are in the timezone offset Has been swapped. In this way, you can not only avoid redundancy, but also: You can display the DST reference information in a specific coordinates, and < / Li> When a country changes the rules, when daylight saving starts and ends, then you have a p

javascript - Why is Google Chrome not converting tags/entities? -

I am going to recapitulate this problem where refuse to parse tags / entities on Chrome text It assigns it via javascript. I previously sent it to & amp; Quot; & amp; quot; Against the " seen with institutions like > and em> . Unlike writing & lt; strong & gt; text & lt; / Strong> . I'm not having this problem with any other browser. IE / FF / Safari / Opera display all the pars and display correctly. Has anyone else gone in this? Is this a bug? Am I doing something wrong? I How can I work first part unit parsing I am still working, this The problem I solved in opposing the text () using jQuery's html ().

Converting a Tuples List into a nested List using Python -

I want to convert a tuples list to nested lists via python. [(1, 5), (5, 4) How can I do that? I have a sorted list of Tuples (sorted by second value), (13, 3), (4, 3), (3, 2), (14, 1), (12, 1) ), (10, 1), (9, 1), (8, 1), (7, 1), (6, 1), (2, 1)] I want it like this (the second value is kept in mind and nested in the lists): [[1], [5], [13, 4], [3] , [14, 12, 10, 9, 8, 7, 6, 2]] I use the other thread here with the map I've seen it, but I do not fully understand it. Can someone provide insight into the 'right' dragon way to do this? group group importing from imported item from operator lst = [(1, 5 ), (5, 4), (13, 3), (4, 3), (3, 2), (14, 1), (12, 1), (10, 1), (9, 1) (8, 1), (7, 1), (6, 1), (2, 1)] result = [[x for x, group y] group, by group (lct, main = mass index (1) ) By group (lst, key = itemgetter (1)) Constants a group of elements continuously LST within which All elements have the same 1 (zero-count) item [group in x, x, y] each H

compatibility - What are some specific examples of backward incompatibilities in Perl versions? -

It has been 22 years between the initial public release of Pearl 1.0 (December 18, 1987) and the current stable release 5.10 . 1 (2009). The following notable releases have been made during those 22 years: Pearl 1.0 (1987 - Initial Release) Pearl 2 (1989) - Better Regular Expressions) Pearl 3 (1989 - Support for Binary Data Streams) Pearl 4 (1991 - Identification of Pearl version as described in Camel Book Pearl 5.6 (2000 - 64 bit support, Unicode string, large file support) Pearl 5 (1994 - Major changes, complete rewrite of the presenter Pearl 5.8 (2002 - Improved Unicode support, new Io implementation) Pearl 5.10 (2007 - New switch statement, regular expression update, Smart Match operator) I am looking for specific examples of back discomfort during Pearl's history Question: 22 years of Pearl In the history of, is there an example of an incompatibility behind Pearl, where Pearl is not a Pearl source code targeting the version X Please go to version

html - Django not rendering CSS correctly -

I have a site that I am creating, part of a stable HTML, the second part is served by Django I should look and stay the same (which is not it?) I have used CSS for a static site. In the same CSS I have almost (nearly successfully) included in the dynamic site. When I create a form, I get a very good two column list on the stable side label input label input label input But, when I do the same code on the dynamic side, it is not very good label input label input label input I CSS is using: form.login label.fixedwidth {display: block; Width: 240 pixels; Swim left; } \. Sorry, here's my form: & lt; Form action = "" method = "post" class = "login" & gt; & Lt; Fieldset & gt; & Lt; Div & gt; & Lt; Label = "username" class = "fixedwidth" & gt; Username: & lt; / Label & gt; & Lt; Input type = "text" name = "user name" value = "" id = "u

How do I efficiently reject Strings in an array if they (regex) match Strings in a second array in Ruby? -

I have two strings of strings, for example sentences and words if a word is found in a sentence eg Sentence = ~ / # {word} / I want to reject the sentence from the sentence array. It's easy to do this with double loop, but I'm thinking that there is a more efficient way to do this, perhaps with logical operators? You can add all the words in a reggae, "|" character. Sentence = ~ / word1 / word2 / You can convert word array into an appropriate regex with array.join Are ("|"). If words are likely to include regex metacharacters, then include each word in non-capturing brackets. Sentence = ~ / (?: Word 1). (?: Word2). .... / Using one of the Rijx should be more efficient than looping through the array of words, since the regex will be compiled into a single state statement.

php - Magento product images new option -

Hey guys, how do I add another option to the product image list? Like remove & amp; Remove the check box @vrnet You were almost there ... Additionally, you need to update You will need to add the code for JSON to handle your new area: /js/mage/adminhtml/products.js (tons of change). I needed to add a second label on my end and the copy pasteing label code was over and the variables had to be changed to match the code variables. Should be very straight forward. (line 66) Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Backend_Media class, you will need to add your new column so that it will be reloaded with DB. If you have any questions, please drop me an email

python - Urllib2 Send Post data through proxy -

I have configured a proxy using the proxyholder and sent a request with some POST data: cookiejar = cookielib.cookieJar () proxy = {'http': 'http: // some-proxy: port /'} opener = urllib2.build_opener (urllib2.ProxyHandler (proxy), urllib2.HTTPCookieProcessor ( Cookiezer) opener.addheaders = [('user-agent', 'user agent')] urllib2.install_opener (openers) url = "URL" opener. Open (url, urllib.urlencode ({"DATA1": "DATA1"}) Then I get a 405 http error (method not allowed) auto-answer The problem was a user-agent header ... Sorry for the stupid question ...

performance - Does ASP.NET MVC perform better under IIS7 versus IIS6? -

I am currently running my ASP.NET MVC app on an IIS6 host, and they are not ready to upgrade Server, nor to transfer my site to the IIS7 server - unless I buy to transfer a new account. Under IIS6, I understand that there are several wildcard mappings for obtaining NetWorkwork to process incoming processes. Connection for each type I believe there is a little overhead on it ... Does ASP.NET MVCV perform better under IS7? I do not think it's still very important to my site, but as it grows, I'll need to understand it. Thank you! .NET applications (whether ASP.NET (MVC or otherwise), WCF, etc.) Better on IIS7 Should run because IIS7 was created with NAT. Please see: IIS 7.0 integrates the ASP.NET Runtime Extensibility model with the main server and takes ASP.NET. This allows developers to extend the IIS 7.0 server fully with the richness of ASP.NET 2.0 and NAT Framework, instead of using the lower level IIS C ++ API. Existing ASP.NET applications get immediate

python - How do I break up the controllers (views) into cohesive files in a Django project? -

I am currently working through the tutorial on Django's website. By completing the following command: Python manage.py startapp polls This creates the following structure: polls / __init__.py groups. As I was going through the tutorial, it has been seen that the idea file can grow in this huge uncomfortable monolithic file, in which the entire web application There is every action in it. Is there a way to break this file into unified squares or files? I tried to change settings.py and url.py to point to a different directory, but it seems that the script generating the file structure creates a "View" module when creating a file, and I have no way To change / override this behavior from the script that appears. Each app you create for this project will have its own views.py file (assuming using this idea), so you do not have to worry about it. Just be sure to keep your app's functionality in mind. From Django Docs: Project vs. App What is t

java - Where are the request method constants in the Servlet API? -

मुझे लिखना है अगर (POST.equals (req.getMethod ()) ) ("पोस्ट" .equals (req.getMethod ())) के बजाय लेकिन मुझे सर्लेट एपीआई (केवल एचटीटीपीएसर्वेटर्यूइव में देखा गया है, जहां मैंने उन्हें उम्मीद की थी) में निरंतर परिभाषाएं नहीं मिल सकीं। वे कहां हैं (मैं बहुत सारे पुस्तकालयों का उपयोग कर रहा हूं, इसलिए यदि कोई अन्य उन्हें परिभाषित करता है, यह भी काम करेगा) ऐसा प्रतीत होता है कि जावा ईई 6 ने एचटीटीपी पद्धति के नामों को स्थिरांक के रूप में जोड़ा है Javax.ws.rs.HttpMethod एनोटेशन इंटरफ़ेस। आपके सेटअप के आधार पर, वे आपके लिए उपलब्ध हो सकते हैं।

sockets - How to copy a char[] in c into my struct -

I am trying to send my straight onto a UDP socket. struct packet {int seqnum; Four data [buffersize]; }; Therefore I have the sender bytes = size (packet); Send four [bytes]; Berzo (sending, bytes); Memcpy ((* Zero *), (Zero *) and Packet, Size (Bytes)); Bytes = Send (sockfd, send, size (sending), 0, (Structure Socadar *) and Client, Client Size); So I'm hoping that my [struct] makes a copy in four. On my receiver int bytes; Bytes = size (structure packet); Four rick [bytes]; Bytes = Ricuffermum (Sokfad, RQV, Bytes, 0, (Structure Sokadar *) and Client, and Client Size); Memcpy ((* Zero *) currentpkt, (zero *) recv, bytes); However with memcpy ((* zero *) currentpkt, (zero *) recv, bytes) on the receiver; I get an error: Error: Can not convert to an indicator type What am I doing wrong? Is there a better way to send my straight onto the UDP socket? ***** UPDATE ***** Thanks everyone for the answers. Finally I '& amp; But my code looks like t

jquery - What am I doing wrong with JQueryUI's tabs feature? -

It sounds really stupid to ask me, but what am I doing? I'm not exactly right about their example, no dice. I assume that you are working with it and it looks like you styled your tabs , And your page needs to include the necessary CSS styles. & lt; Style & gt; .ui-tabs .ui-tabs-hide {display: none; } & Lt; / Style & gt; In addition, if you use something and observe your page, you will see that it is going to work and implement the right CSS classes for the elements.

AppleFairplayTextCrypterSession::fairplayOpen() rashing iPhone on startup -

I'm trying to figure out that there was a mysterious accident at startup here and when the console appeared in logs , AppleFairplayTextCrypterSession :: fairplayOpen () failed ? The iPhone app will connect to the remote server for XML data and if the server is down then this app will crash. Later on startup, it will crash until I reboot and will sync iTunes again. I admire it so much that if someone can give me some clues so that he can stop the accident and get out of peace by catching it, unknown kernels [0] & lt; Debug & gt;: AppleFairplayTextCrypterSession :: fairplayOpen () unsuccessful, error -42184 Sun Dec 6 22:50:31 Unknown SpringBoard [25] & lt; Failure to get the work name port for verse 140 failed: MySpace failed: (OS / Kern) Failure Sun December 6 22:50:31 Unknown com.apple.launchd [1] & lt; Notice & gt;: (UIKitApplication: com -. MyApp [0x554B]) Excited: Cool Sun 6 December 22:50:31 Unknown com.apple.launchd [1] < P> I think the

polygon - How do I cut triangles out of a concave Delaunay triangulation? -

I am using Delaunay to triangulate a concave polygon, but it fills in the components I have the boundaries of polygon How to remove the triangle automatically? Self-answer: In some cases, it is impossible. Self-answer: In some cases, this is impossible. I need to use vibration dropout algorithms:

php - Counting an eliminating duplicate associative values in an array -

I have the following issue, I have an array with $ data name of this array Within me is something like [6] => Array ([code] => 642 [total] => 1708) [7] = & gt; Array ([code] => 642 [total] => 53) [8] = & gt; Array ([code] => 642 [total] => 1421) The code element is the same, now what I want to do is get the same code value together, and the sum Add together I tried to do it in the foreshop loop, but it does not seem to work. I do something like this $ old_lc = null; $ Old_lcv = 0; $ Count = 0; $ Dd = null; Foreign currency ($ $$ data) {if ($ d ['code'] == $ old_lc) {$ d ['total'] = $ d ['total'] + $ old_lcv; $ Count--; $ Dd [$ count] ['code'] = $ d ['code']; $ Dd [$ count] ['Total'] = $ d ['total']; } And {$ dd [$ count] ['code'] = $ d ['code']; $ Dd [$ count] ['Total'] = $ d ['total']; $ Count ++; } $ Old_lc = $ d ['Code']; $ Old_lcv = $ d ['

asynchronous - How to force Sequential Javascript Execution? -

I have found complex answers related to classes, event handlers and callbacks (which are somewhat shy to me). I think callbacks can be useful, but I can not apply it in the simplest context. See this example: & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Function myfunction () {longfunctionfirst (); Shortfunctionsecond (); } Function long before () {setTimeout ('Warning ("Firstly finished");', 3000); } Function ShortfunctionSend () {setTimeout ('Warning ("Second Function Ended");', 200); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; A href = "#" onclick = "javascript: myfunction (); return back;" & Gt; Call my function & lt; / A & gt; & Lt; / Body & gt; & Lt; / Html & gt; In this, the second function is completed before the first function; --- Edit --- This is because the easie

asp.net - add pages to masterpage gives me javascript error -

I have a page that uses some javascript code to run, it was working fine This master page But gives me an error from javascript var fu1 = document.getElementById ("FileUpload1"); Var ex1 = extension (fu1.value); Where do I add javascript to the master page Try var fu1 = document.getElementById ("& lt;% = FileUpload1.ClientID%>"); Var ex1 = extension (fu1.value)

Using C++, how do I read a string of a specific length, from a non-binary file? -

Shows that a line can be read using the getline function. However, I do not want to get the full line; I want to get only a certain number of characters. How can I be done in such a way that character encoding be preserved? I need a function that does something like this: ifstream fileStream; FileStream.open ("file.txt", iOS :: In); As a result & lt; & Lt; GetString (file stream, 10); // Read the first 10 character file. Futel (10); // Go to the next item's result section & lt; & Lt; GetString (file stream, 10); // 10 more characters to read I thought about reading a four buffer, but could not this character change the encoding? I really doubt there is some confusion about the word "character" here. Looking at OP's question, they are using the word "code", which is used for the use of char (as opposed to a rational "character", as the character of multi-byte UTF-8) , And thus the purpose of reading fro

css - adjusting div position -

How can I adjust the div with the right center of the screen at any resolution with the condition: complete. ?? If the div has the width and height known, you can use the negative margin: div {status: complete; Width: 800 pixels; Height: 500px; Left: 50%; Top: 50%; Margin-top: -250px; Margin-left: -400px; } The negative margins are half of width and height. If the size of the div is not known or the liquid is, then you have to use javascript. How is it that it is working using jQuery: $ (function () {$ (window). Reset (function () {$ ('div.something'). CSS ({Left: $ (): ($ () ($ (this). Wide () / 2), top: $ (window) .hite () - ($ (this) .height () / 2)} )}}); $ (Window) .resize ();});

maintain hover menu on mouseover in jquery -

I have a table with some customer data I verb (edit, delete, see) for the customer is using jquery hover to show. Below is html: & lt; Table id = "hovertable" width = "100%" cellpadding = "0" cell spacing = "0" & ​​gt; & Lt; TR & gt; & Lt; TD & gt; Line 1 column 1 & lt; / Td> & Lt; TD & gt; Line 1 column 2 & lt; / Td> & Lt; TD & gt; & Lt; Input type = "hidden" name = "iVal" value = "1" /> Line 1 column 3 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Line2 column1 & lt; / Td> & Lt; TD & gt; Line 2 column2 & lt; / Td> & Lt; TD & gt; & Lt; Input type = "hidden" name = "iVal" value = "2" /> Line2 column3 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Line 3 column 1 & lt; / Td> & Lt; TD &

ASP.NET MVC + jqGrid -

I am using jQgrid with asp.net MVC I am having some problems when I was created DOM, So I would like to draw a grid, but I would like to load the data, when I select the tab in a tab page. I can not find any examples for this I am using a custom navigation bar: ("#AttagentsGrid") Navigrid ('# attachments pager', edit: wrong, add: true, del: true, search: wrong}); After some selection on the tab (jQuery UI), I can see that buttons of nav bar are repeated. With the selection I have a big problem. I can not choose any other line but before anyone had to face the same problem? Best Relationship Alberto To prepare the DOM To prepare the grid, but to populate it later, you can initialize the grid using the local data store: Datatype: "local" < / Pre> Then, when you select the appropriate tab, start an AJAX request to get your data. When the data is retrieved, you can do this to load it in the grid: // populated grid data jQuery (&quo

asp.net - DataList control -

I used the 2005 VS 2005 web site project as VS And find out that the html generated by my datalist control was changed. MadStandard: & gt; Itemmetlet & gt; & Lt; ASP: label ID = "cellhelbell" runat = "server" text = '& lt;% # Eval ("cell")% & gt; Visible = '& lt;% # Eval ("cell"). ToString ()! = "0"%> / & Gt; & Lt; ASP: text box id = "celltextbox" runat = "server" text = '& lt;% # bind ("cell")% & gt; Visible = '& lt;% # Eval ("cell"). ToString () == "0"%> / & Gt; & Lt; / ItemTemplate & gt; Now it always generates the integers of duration , duration and input . I use the DataSource property to bind the DataList control. My Page Code: Public Zero Page_load (Object Sender, EventAgds E) {If (! This .asportback) myControl.DataBind (); } MyControl (Datlist Control Controll) code: public class

osx - Ruby for romance? How to update a script from itself -

My wife enjoys it when I use my Geek capabilities to be "romantic" so I installed Ruby script There was an idea to do on my Mac which send me quotes and small notes all day. I already thought that I am using GeekTool to run a script in the background and I will use growlnotify to display the message. Now what I need is one way to update the script from the web is that I change it. I basically do not know anything about Ruby other than how to interact with the console. I have 2 goals: 1) There is an XML file with messages, it needs to be updated-enabled from the internet, but if it is local, it does not have a network connection. 2) If I see a bug or want to correct it, then update the script to the Internet. Now I know that I can manually update the script on my Mac if I wanted to, but I thought it would be a good way to learn some more advanced Ruby. The priority will be 1 XML file, if it changes, then a new version will be able to download I already used HypriCo

multi tenant - How Handle multiple customers in a single grails application with customised look and feel? -

My app needs to support multiple clients at the time of running. They will display all similar data, using the same controller, services, but with different layouts, CSS and images. My basic idea is as follows: 1) The session has a filter to validate and set a configured value 2) My controller code will make some calls with these lines : Submit (See: "/ $ {session.userContext} / test / test") Therefore, we will render for Customer 1: Idea / Customer 1 / Exam / Test. Gsp Ideally I would like to / view / customer1 / directory for all custom views and layouts, but site mesh / views / The layout looks for layouts in the directory and I can not find any way around it. In this sense, the solution is a little clunky because I can not find a level of separation. What would be ideal if I could set the root of the race, instead of starting with the idea of ​​method on runtime, look at thoughts / customer 1, I do not know how to do this, but most of them Looks like a good

routing - MVC - Creating new Views without adding Actions to Controller -

I am working on a mini CMS-like application using asp.net MVC 1.0 (I will renew it 2.0 is ongoing). Once I want to have a feature, it is very important for CMS, an administrator has the ability to add pages to your site. Essentially, if the administrator wants to add a page called "Link", then I want him to be able to do this without implementing the controller and without compromising the new assembly. I have an idea for a solution and I want to know that the community thinks. I think I should write a class (for the argument it is called User Generated Generic Controller) which extends to the Controller Class. In this class, I will have a single action which reads a parameter and redirects in View which corresponds to the passed parameter in the action. I also need to edit the routing in global .asax.cs file Therefore / user generated generic controller / link Hit the same action which would be / user generated generic controller / news , but display the d

c# - Exception: Specified cast is not valid -

सार्वजनिक वर्ग UserLoginInfo {सार्वजनिक UserRole भूमिका; सार्वजनिक स्ट्रिंग उपयोगकर्ता नाम; सार्वजनिक [उपयोगकर्ता] उपयोगकर्ता [उपयोगकर्ता नाम], [पासवर्ड] [भूमिका] से [उपयोगकर्ता] का प्रयोग करते हुए (यूआरएल, यूआरएल, यूआरएल, यूआरएल, WHERE [उपयोगकर्ता नाम] = @ उपयोगकर्ता नाम ", कनेक्शन)) {command.Parameters.AddWithValue (" @ उपयोगकर्ता नाम ", उपयोगकर्ता नाम); (Var reader = command.ExecuteReader ()) {if (reader == null ||! Reader.Read () ||! यूटिल। हैश। चेकपॉज़वर्ड (उपयोगकर्ता नाम, पासवर्ड, (बाइट []) पाठक ["पासवर्ड"] )) नए अपवाद फेंक ("गलत उपयोगकर्ता नाम या पासवर्ड।"); नया यूज़रलागिनइन्फो {उपयोगकर्ता नाम = (स्ट्रिंग) रीडर ["उपयोगकर्ता नाम"], रोल = (यूज़ररोल) रीडर ["रोल"]} लौटाएं; जब मैं एक ब्रेकपॉइंट डालता हूं और डीबग करता हूं, तो इस लाइन से त्रुटि आती है नया यूज़रलागिनइन्फो वापस आ गया है (उपयोगकर्ता नाम = (स्ट्रिंग) रीडर [" उपयोगकर्ता नाम "], भूमिका = (यूज़ररोल) रीडर [" रोल "]}; मुझे समझ में नहीं आ रह

shell - I'm trying to make bookmarks in Filezilla be availble on the desktop -

So far this looks like bookmarks available only in framzilla, but I want to show them on desktop shortcut links. Perhaps a shell script will work? I am trying to find (Arguments / Criteria / Options) which I can pass in FileZilla via the command line, but there is no luck yet / google / etc I am still scrutinizing their documentation and wiki But I do not mention anything to do this. I have done similar work with Winin and Edepado in the Linux Mint over the past few times, but I want to find a way to get the listed parameters only somewhere correctly on OSX Will not be different? This is needed for my friend, but I think it can easily be ported along with Linux and Windows later. itemprop = "text"> The documentation for command line parameters for FileZilla is. It seems that the closest you have to get is: -c, --site Connect to the site provided from the site manager of different characters The site should be given as a full path with a slash in the form

java - Eclipse CVS ignores .class files -- how can I turn that off? -

I want to do new class files in CVS through eclipses, but these files are ignored, and I'm not sure where to stop it to do a section windows, but. The class is not listed. Preferences> Team> Rare Resource Also view all files Change to a resource perspective.

SQL Server Comparing Subsequent Rows for Duplicates -

I am trying to write a SQL server query, but there was no luck and wondering how anyone Any idea may be get my query. What I'm trying to do: I have several column tables whose names I am working with TaskID, StatusCode, Timestamp. Now in this table, the work for one of our systems has been completed, which runs throughout the day and when some runs are done, then the timestamp and the status of the work is done based on the situation. Sometimes whatever happens, the work table can be updated with a new timestamp, but the status code will not change after the last update of the work so that two or more consecutive tasks The status code for rows can be the same. When I say that consecutive rows are meant in relation to the timestamp. For example, there may be twenty rows on position 2 in position 88, after which the status code turns into something else. Now I'm trying with no luck in that destiny, he is to receive a list of all functions and Stetsods and timestamp,

java - Finding Date Difference -

What is the efficient way to say whether a date is compared to some day 5 days earlier? Do I need to parse both days before using a particular simple data format before comparing it? itemprop = "text"> days = (date2.getTime () - date1.getTime ()) / 86400000L

php - One page website with CodeIgniter and jQuery(AJAX) -

I am looking to create a one page website, which runs on PHP By the form of CodeIgniter ) and AJAX (supported by jQuery ), at this time I have a menu that gets populated from the database, what catergories If the depening line is selected on the line, then create the URL using those results, if (isset ($ main_menu)) {foreach ($ main_menu $ line form) In) {print " My problem is that for this I need to run all the questions from the controller because the user can never leave the page, what I want to do effectively Yes, it is that if the user clicks on blog for example, then I want to run a query, which selects all content related to the blog category from the content table in the database, then I this I want to display in an Aridion style, in my site's right content div , if the user selects for example inspiration then the query runs again, and the motivation data to blog on the same div Adds as data, but not written on own accordion and on blog data. Is

.net - C# TypeConverters and IsValid -

मैं System.ComponentModel.TypeConverter का उपयोग करने के लिए विभिन्न प्रकारों में System.Strings का एक समूह डालने का प्रयास कर रहा हूं। ये स्ट्रिंग TypeConverter के लिए एक वैध प्रारूप में हो या हो सकता है, इसलिए मैं टाइप रूपांतरण का प्रयास करने से पहले उनकी वैधता की जांच करने के लिए एक रास्ता खोजना चाहता हूं (सिस्टम को पकड़ने पर निर्भर होने से बचने के लिए। FormatException स्ट्रिंग इंगित करने के लिए सही स्वरूप में नहीं है)। बढ़िया, यही कारण है कि TypeConverters के पास एक IsValid () विधि है, है ना? वैसे मैं एक ऐसी समस्या में भाग रहा हूं जहां IsValid () सच वापस आएगा, लेकिन जब मैं कन्वर्टफ़ॉर्मस्ट्रिंग () को कॉल करता हूं, तो यह एक अपवाद फेंकता है इस समस्या को पुन: उत्पन्न करने के लिए यहां कुछ कोड दिया गया है: System.ComponentModel.DateTimeConverter दिनांककन्वयन = नया सिस्टम.कंपनेन्टमॉडेल.डेटाइम कनोंवर (); स्ट्रिंग TheNumberZero = "0"; If (DateConversion.IsValid (TheNumberZero)) Console.WriteLine (DateConversion। ConvertFromString (TheNumberZero)। ToString ()); Else Conso

struts2 - Configuration manager shouldn't be null error -

We have a war in which the S2 code and have been deployed war Glasfis. We to see that Configuration Manager should not be null error when we deploy the code and try to use the application (browser). The error does not occur when the application server is restarted after deployment. Sign in: [# | 2009-12-04 t 12: 55: 47.215-0500. Saver | Suraj-apsarar 2.1. Org.apache.catalina.core.ApplicationFilterConfig | _ThreadID = 48; _ThreadName = RMI TCP Connection (5846) -127.0.0.1; _rekvestid = D8d8l2b6-Klel-4b56-A707-68e07lffb9e9 ;; Anupryogfiltrconfigkdoapraijlej java.lang IllegalStateException: Configuration Manager should not tap on org.apache.struts2.dispatcher. sun.reflect.NativeMethodAccessorImpl on Dispatcher.getContainer (Dispatcher.java:849) at org.apache.struts2.dispatcher.Dispatcher.cleanup (Dispatcher.java:256) .apache.struts2.dispatcher.FilterDispatcher.destroy (on org). Sun.reflect.DelegatingMethodAccessorImpl .invoke (delegatingMethodAccessorImpl.java}) at sun.reflect.N

c# - String.comparison performance (with trim) -

I need to do a lot of high-performance case-insensitive string comparison and I realized that way. ToLower () trim () is really stupid because all new strings are allocated so I dug around a bit and looks better like this: String Compare (txt1, The only problem here is that I want to ignore leading or trailing spaces, i.e. trim (), but if I use trim then i have the same problem with string allocation. I check every string I can see and can see that it starts with ("") or ends ("") and only then trim. Either it is or has indexed the index, pass the length and string for each string Compromise Override , Public Static Ent (String Stra, int indexA, String strb, int indexB, int length, StringComparison comparison type) But it seems that I get disturbed and use some integer It does not matter if I can not really make it bigger - if more and more statements for each combination of trailing and leading spaces on both strings .. then any ideas of an elegant so

c# - Constant abuse? -

I have run in a few bundles of code in some projects, which have the following constants: const int ZERO_RECORDS = 0; Const int FIRST_ROW = 0; Const int DEFAULT_INDEX = 0; Const int STRINGS_ARE_EQUAL = 0; Has anyone ever seen such a thing? Is there any way to use constants to represent language structures? IE: The first index of C # in array is on position 0. I think that if the developer needs to be constantly dependent to tell that the language is based 0, then there is a big problem in hand. The most common use of these constants is in dealing with data tables or in 'for' loops. Am I thinking that these codes are odor? I think these are not perfectly better: const int zero = 0; Const String A = "A"; Abuse of IPHO "zero" is just one of the basics. While STRINGS_ARE_EQUAL might be easy, why not ".quals"?

.net - Rotating portfolio of several websites -

I have raised a banner to create a portfolio for my web design / development group. This portfolio will be full screen on a nice flat panel TV and will rotate through a list of our websites that we have created. This is really the only requirement - when they enter our office, show people our work on a big TV for Ogle, I've tried some different methods and have hit a wall on each of them, so I Here for a little bit of help, I am changing. While a stable screenshot will probably be the easiest way to get a portfolio, it will not be that many of your websites do judge, which includes video, motion graphics or other interactive features. Whether the screenshots may have to make a good deal of maintenance, they will become outdated in the form of websites. So I dynamically loaded a list of URLs. This solution seems to be the most scalable and accurate ... If I could actually do it, I would have done with making use of AJAX requests with JACKS or to capture HTML and inject it in

Visual Studio 2008 Professional vs VS 2008 Team System -

I am using I'm using the Team Explorer integration / source control plugin. My trial is ending and I have trouble finding information about what I want to buy. I do not really need to run a TFS server, but I need the ability to connect and put files to my clients, and integration with Team Explorer in VS is really good, so I do not want an external Use third party tools Do I need a team system to accomplish this, or does Visual Studio 2008 Professional have the same TFS plug Does not, and what works so well? I do not believe that I am experiencing so much hardship in finding differences between such editions ... if someone has a good resource, t is needed. I mainly need ASP Develop .NET Solutions if it matters. Thanks! I do not really need to run TFS myself Server, but I need the ability to connect with my customers Any TFS running will purchase the CL (Client Access License) so that it works with this server Any customer to be covered should be covered. I be

c# - Sending and receiving SOAP messages -

I am writing a web service client in C # and do not want to create and serialize / deserize objects Rather, sending them and receiving them is the raw XML Is it possible in C #? Here is a part of an implementation based on the example of John M. Gant. Setting the Content Type Request Header is important, besides my request, credentials are required. Protected Virtual WebQuest Contrast (ISO Message Message Soap Message) {var wr = WebRequest.Create (soapMessage.Uri); Wr.ContentType = "text / xml; charset = UTF-8"; Wr.ContentLength = soapMessage.ContentXml.Length; Wr.Headers.Add ("SOAPAction", Soap Message SoapAction); Wr.Credentials = Soap Message Credentials; Wr.Method = "post"; Wr.GetRequestStream (). Write (encoding. UTF8.GetBytes (soapMessage.ContentXml), 0, soapMessage.ContentXml.Length); Return return; } Public Interface ISoapMessage {string URI {get; } String ContentXml {get; } String SoapEction {Receive; } {Receive ICredentials credenti

C++ "Scrolling" through items in an stl::map -

I have created a method of scrolling around the map of the items, so that if the end is reached, then the method MyMap :: const_iterator = myMap.find (myKey); If (this == myMap.end ()) 0; If (next) {this ++; If (this == myMap.end ()) {this = myMap.begin (); }} And {if (this is == myMap.begin ()) {this = myMap.end (); } this -; } You can do this with a template as told by the previous poster It may be cumbersome from the point of view that it never reaches to the end so that the user should control it anyhow. I'm assuming that you have a good reason, maybe creating some round robin behaviors #include & lt; Iostream & gt; #include & lt; String & gt; # Include & lt; Vector & gt; # Include & lt; Set & gt; # Include & lt; Map & gt; using namespace std; Template & lt; Class T & gt; Class Scroll Itater {Public: Scroll Iterator (T & amp; Micrate, TypeName :: Etherator Pauses): CTR (Micro), This (Pause) {} Scroll Iterat

c# - Run SQL statements from ASP.net application -

I need to run my own SQL statement from the application. I mean the user ASP.N.T Can go to the app, take a box and run SQL statement from there I'm already doing something like this This dynamic SQL is running Do this. There is an optional SQL parameter, but your users will need to define and define different parameters from T-SQL. You can simply use SQL Command Object on SQL Server to SQL Server; There is no real advantage to wrapping in an EXEC or something, as you did in the link provided you can handle exceptions on the .NET side. In addition, if you want to support command batches, keep in mind that SqlClient and friends do not understand "GO", which is not real T-SQL Command - to parse you input And it will need to break into your batches. I'm sure you understand that there is a big security risk to do this, and it is generally not recommended. You may consider using a connection string that specifies the user with limited permiss

iphone - How I force a "container" UIView to have no CALayer? -

I'm trying to preserve memory consumption about my visualization. I have a scroll view with a container vee that contains some hairy scenes. I would like to end the collar of the ScrollView and Container Weave, therefore, memory is consumed only during the thoughts of the child in redraw etc. How can I do this? Thanks, Doug All UIViews and UIView subclasses are supported on the iPhone CALayers It is not really that what you can do to avoid it because it is a perception made by UIKit (in Coco for Mac, you can specify what views the Calaira is!) When you can be able to hack some things and destroy the calorie of some scenes Not, then I'll do not recommend I was very much the same type complex painting app, and consuming I never had any problems, memory large amounts of that Kailayron. Remember, you can safely use approximately 25 MB of storage before your app receives a memory warning. If you are seeing your app through a large volume of memory and you are just dra

nerdtree - VIM and NERD Tree - closing a buffer properly -

Does anyone know how to close a buffer in VIM when using NERDTree without messing all of its windows Go? The NERD tree normally breaks your display into two vertical windows (the browser on your left, and then on the right side of your main window). If you close the buffer, you decrease in a huge file browsing window. If you select the second file, then the second window opens, but it separates it horizontally from any idea? I do not use the NERD tree, but if I understand correctly, Want to close the window without a buffer? If my argument is correct, then try this script. "Delete the buffer while keeping the window layout (do not close buffer windows)." Version 2008-11-18 from http: // vim Wikia.com/wiki/VimTip165 if v: version & lt; 700 || Exists ('loaded_bclose') || & Amp; If you have a closing endif, go to loaded_bclose = 1 if it exists ('bclose_multiple') bclose_multiple = 1 endif display the message function saying "message"

oracle - ORA-02014- How do I update a randomly selected row from a table? -

I tried to randomly select card a card from a table with the columns be'm a using the procedure c_value and c_suit after selecting it, the process has been field 'Y' to needed. cursor can create as CUR_GET_RAND_CARD or process c_suit select replace j_prc_sel_card (p_value out numbers, p_suit out number) c_value, (c_value, c_suit, jackson_card by dbms_random.value Select from the order) Where to get ROWNUM = 1 for the update; Open BEGINCUR_GET_RAND_CARD; Fetch CUR_GET_RAND_CARD in p_value, p_suit; Updated jackson card = 'y' where c_value = p_value and c_suit = p_suit; Close CUR_GET_RAND_CARD; End; Then I am trying to get the selected card and output which is in the form of the beginning. With it: set server output; DECLARE v_value number; V_suit number; BEGIN j_prc_sel_card (p_value = & gt; v_value, p_suit = & gt; v_suit); DBMS_OUTPUT.PUT_LINE (v_value); DBMS_OUTPUT.PUT_LINE (v_suit); End; / <> However I found an error in the tit

winforms - Even though form3 is created from form2, why it is not disposed on form2 close? -

I need your help to clarify whether the form is exactly like an object? If I make an object obj 2, then oz 1 Obj2 will be disposed of obj1. Although this is not the case with the case & amp; Give the pseudo code down. I have three forms; Form1, form2 & amp; Form2. form1 is the startup form I will make a form 1 and how to create a form 2 and to 2 & amp; Show form 3 using one button in each form. If I close Form 3, after opening all 3 forms, I am able to work in Form 1 and Form 3. Form 1 public class form1 personal sub cmdOpenForm2_Click (ByVal, as in this System.Object, ByVal E) System.EventArgs handles as cmdOpenForm2.Click dim frm frm with new form2 '' / as. MdiParent = frmMain .how (). End with the BringsToFront () end sub-private sub form1_Disposed (ByVal as the object, as byVal E. System.EventArgs) handles Me.Disposed '' //frmMain.tsStatus.Text = "Form1 Settlement", The End Sub Class, Form 2 Publ