Posts

Showing posts from July, 2011

Ruby on Rails - Rounding ones, tens and hundred digit places -

I want the round of people and ten points of Poiton for the value .. If it is 1999, it should be shown as 1900 and if it is 19999 then it should show as 19000 {code_name} { All_cost.to_money.format (: no_cents)} You can round like this:

encoding - How to decode a string on runtime in java? -

I am creating an email client, when I receive an email from the Blackberry server, then this file name "=? Utf -8 "? B? AnBlZ2F0dGFjaG1lbnQuSlBFRw ==? = "But the original file name was" jpegattachment.JPEG ", and for some time when I get from other mail servers, I get plain text so here my problem is that I can get a string that can not be encoded . Is there any way, I can get the encoding of the string and put it in plain text. Either the input string "=? UTF-8? B? AnBlZ2F0dGFjaG1lbnQuSlBFRw ==? = "Or" JPGactact. JPEG should be "output" jpegattachment.JPEG ". Any Idea ?? It is MIME-encoded, although Base64 is the most popular, it can use other encoding such as quoted-printable, binary etc. Therefore you should use the current DDOD, in any mail program the decoder will be created. You can use decodeWord () from java mail, try deocdeText () if you want to leave plain text alone.

c# - WinForms StatusStrip Label and Progress Bar Not Visible When Spring is Set -

I have a Net 3.5 Winforms application with a status bar on the bottom. In the status bar, two labels and progress bar are set correctly with the spring property, the status bar is set to the layout table but they are not appearing on server 2008, but works fine on server 2003, XP and Vista. Has anyone come on this? I can see anything on Google, maybe it's me only Any thoughts?

c++ - Capturing real time images from a network camera -

What is the best way to stream MJPEG from the network's IP camera? I like to get them to frame and process them using C ++ (or Extended Python with C ++). Is OpenCV is my best choice? App to OpenCV, you can use the MPlayer - one of the two uncompressed images of the twin yuv4mpeg You can redirect to a pipe to receive the stream. You can make MPlayer process and pipes from C ++. Another way is to use the RTSP Library (your IP camera probably uses it as a protocol)

.net - GA Framework for Virtual Machines -

Does any NAT genetic algorithm know about the framework that virtual to solve allocated problems to develop Is set in machines? I would be especially interested in a framework that allows virtual machines to broadcast themselves within a pool and the required inputs are developed against the fitness function set with the data set with "good" output. There is a framework for developing programs that is retraceable - if no CLR target exists You can make one. It has been It has received sponsorship from Intel.

html - Images In Javascript -

I am creating a small application where multiple images are displayed and when a user clicks on a single image So it gets bigger that changes the image which is in between. But I can not find the picture clicked. & lt; HTML & gt; & Lt; HEAD & gt; & Lt; SCRIPT LANGUAGE = "text / javascript" & gt; Function swapes (this.id) {document.write ("in swapes"); Switch (this.id) {case img2: IMG1.src = "component1 / images / image1.jpg" intImage = 2 return (wrong); Case img3: IMG1.src = "component1 / images / image1.jpg" intImage = 2 return (incorrect); Case img4: IMG1.src = "component 1 / picture / image 1. Jpg" intImage = 2 return (wrong); }} & Lt; / SCRIPT & gt; & Lt; / HEAD> & Lt; Body & gt; & Lt; IMG id = "IMG1" name = "IMG1" src = "image1.jpg" height = "100px" width = "100px" & gt; & Lt; IMG ID = "IMG2" name = "I

accessing php session from a command line java program -

I am preparing an enterprise security server for our company - we own many different applications, most are Java And some have been written in PHP. I can provide a remote API that will give each application access to the server. I can also create 'agent' which can be included in each application which will do all the work for them, but allow their servers to control their sessions and thus their certification / authority. The problem is that it would be better to write the agent in Java because 80% or more apps are in Java. If I have written an agent in Java then does anyone know whether there was a program that did this program Could reach php session? If anybody does not get any suggestions in better way to go about this? Session data stored as a serial array (php) in a temporary folder. The locations for these are set in the php.ini file. But you can write both the format of the data and the location (for example database or shared memory or elsewhere) your own

javascript - What does this code do? -

Discuss about the lack of dislike buttons At this time there is all the anger on Facebook and various groups have offered the dislikes button Click on, but only after that you can invite x amount of your friends. As part of the process of joining one of the more (potentially devious) groups, you need to run Javascript. I have never done web coding, so I am thinking that someone will tell me What does the following code do? javascript: elms = document.getElementById ('friends'). GetElementsByTagName ('Li'); (Different fiddles in elm) (if (typef elm [feed] === 'object') {fs.click (elm [feathered]);}} group link is here The code is listed in the latest news section under 3 steps. // Find the element in the webpage that is the "Friend" id, which is the list of your friends ;-) Javascript: Elms = document.getElementById ('Friends'). GetElementsByTagName ('Li'); // Replace each friend in the list (different FIDs in Elm) {//

android - Where definitions in public.xml are linking to? -

After Let me explain with an example 'android.R.layout.simple_list_item_multiple_choice'. It was used to create multi-select lists but only the definitions I found: /platform/frameworks/base/core/res/res/values/public.xml: < Pre> & lt; Public type = "layout" name = "simple_list_item_multiple_choice" id = "0x01090010" /> /platform/frameworks/base/api/current.xml: & lt; Field name = "simple_list_item_multiple_choice" type = "integer" transient = "false" vaporized = "false" value = "17367056" constant = "true" last = "true" deprecated = "deprecated" visibility = "public" & gt; But where is the actual layout defined? When a multi-select list is created, I see the checkbox, from where it comes? See $ ANDROID_HOME / platforms / $ YOUR_PLATFORM / data / res / layout / simple_list_item_multiple_choice. Xml , where $ ANDROID

python - Convert a timedelta to days, hours and minutes -

I have a timetable I want that day, hours and minutes - either as a taple or a dictionary. .. I have no problem. I have done this once in a dozen languages ​​over a period of time, but Python is usually a simple answer to everything, so I thought I had some nimbi (simple yet verbose) destroyed mathematics Ask here before doing this. Mr. Fuz raised a good point. I "Dealing With Listing" (eBay listing like a bit) where each has a duration. I am trying to spend time by doing when_added + duration - now Is I saying that there will be no account for DST? If not, what is the easiest way to add / subtract an hour? If you have any Datetime.timedelta value td , td.days already you want "day" to enter TimeDelta value to hold the fraction of the day in seconds (straight hours or Not so) so that you will have to actually "cause the simple math", for example: def days_hours_minutes (td): return td Days, td.seconds // 3600, (td.seconds // 6

iphone - Formats for communicating between backend and Objective-C/Cocoa -

I am developing an iPhone app that is connected to the backend server. Many times it needs to communicate many times through requests, I am sending an HTTP message, but I want to get more complex responses, which I can parse somehow. It is believed that I can provide the format of any format for reactions from the server, so my question is: Which would be easy to use / parsing for purpose-c / coco (maybe and Too fast), and result in any kind of a dictionary? I know that this is a little subjective, but I still feel that it is a valid question, some programming languages ​​have fewer formats and less support for others. You can use a dictionary to read a plist file. If your plist data is not in a file, then you can do as well as a NSDT object in a dictionary with + [NSPropertyListSerialization dataFromPropertyList: format: errorDescription:] Convert plist data or change NSString into dictionary with - [NSString propertyList] .

iphone - Best way to split and convert url params into string values -

I would like to split a custom URL to open an app in the price in the iPhone, my plan would be: apijem: // user = Johns mith and message = Blah% 20 blah Where do I get "user" and "message" as two nssring Would like to Any advice on the best way? Your URL is in the NS URL object url < / Code> is called: NSMutableDictionary * queryParams = [[NSMutableDictionary alloc] init]; NSArray * Component = [[URL query] Separation from components: @ "& amp;"]; (Component in NSString * component) {NSArray * pair = [isolated from component components: 0 "="]; [Query parameter set object: [[Combination object atindexx: 1] StringBeerPlacingPark escaping encoding: NSMOROSRON staining encoding] KK: [pair objectwithoutx: 0]]; } ... [queryParams release];

storage - Storing and recalling variable number of text strings in LaTeX -

I am currently writing an API document in latex. I have a tabular environment with a list of error codes and details such as: \ begin {tabular} {| C | L |} \ hline \ textbf {code} & amp; \ Textbf {Details} \\ \ hline 1 & amp; (Details of error 1) \\ \ hline 2 & amp; (Details of Error 2) \\ \ hline \ end {tabular} Later on in different documents in the document, I refer to an error code and its details at the same time, such as: Possible error status: \ start {itemize} \ item 1 --- (error description 1) \ end {itemize} I I want to automate the process so I do not have to type the details again every time I try to use a counter, labels, and \ savebox command , But it is very complex: \ newcounter {error}% in tabular environment: \ newsavebox {\ ErrorOne} \ savebox {\ ErrorOne} {(description of 1 error)} \ Refstepcounter {error} \ label {errorOn} \ Arabic {error} & amp; \ Usebox {\ ErrorOne} \\ \ hline and later, to reference the error, \ {errorOne

Removing a function at runtime in PHP -

I know that this question is awkward and strange, but is there a way to delete the function in runtime in PHP? I have a recursive function declared in the "if" block, and that function must be placed in the "if" block in the "valid" block. I do not want this function to be called outside of this block. I have come to know but not enabled on my web host BTW I only support PHP 5.1.0. Edit: I knew how my question was, but this is the exact thing that I want to do: if (function_exists ('Get_magic_quotes_gpc') and @get_magic_quotes_gpc ()) {function strips lash_dip ($ value) {return is_array ($ value)? Array_map ('strips lash_dip', $ value): stripsshash ($ value); } $ _POST = array_map ('strips lash_dip', $ _POST); $ _GET = array_map ('strips lash_dip', $ _GET); $ _COOKIE = array_map ('stripsshash_dip', $ _COOKIE); $ _REQUEST = Array_mape ('strips lash_dip', $ _REQUEST); // runkit_function_remove

c# - List<> Better to init with a maximum capacity and only use a fraction of that, or init with no capacity -

I have list is that I am starting to empty, and I have to populate this structure in a loop just as I parse the data. I know that the maximum possible number of entries to be entered in this list is 1000 for now. However, after my parsing of 1000 entries I can only put 2 in the list. So should I start a list of 1000 capacity or not specify any capacity and just add some entries. However this can end all adding 1000. What is the best way to display? If it can be really different that broadly, then you do not want to set the capability For most collections, the more the capacity is, the same (as I believe is the default capacity of 16), so your ability comes to you very close to meet your maximum limit.

java - ResultSet exception - before start of result set -

I ResultSet is having trouble receiving data from object here is my code: string sql = "SELECT type FROM node WHERE nid =?"; Submit Prepared Placement = conn.prepareStatement (sql); Int meetNID = integer Parasent (node.get (BoutField.field_meet_nid)); Prep.setInt (1, meetNID); Results Result = prep.executeQuery (); Result.beforeFirst (); String found type = result .getString (1); If (! FoundType.equals ( "meet")) (new illegal orientation exception throwing (string. Format ( "node% d" must meet "but% s, meetNID, foundType));} error: Thread exceptions "main" java.sql.SQLException: Com.mysql before starting the set results Comkmysqlkjdbc. in. Com.mysql.jdbc.SQLError.createSQLException at jdbc (SQLError.java:981) at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:986) SQLError.createSQLException (SQLError.java:1072) com.mysql. on jdbc.ResultSetImpl.checkRowPos (ResultSetImpl.java:841) com.mysql.jdbc.ResultSetImpl.getStri

asp.net - Proper setup for IIS7.5 machine account for anonymous Web site access -

Using IIS 7.5, IIS_IUSRS is considered to be the account to use. I get '401 - Unauthorized: Access denied because of invalid credentials' error. If I have read, then all this works. But not everyone has an account. Any ideas why IIS_IUSRS does not work? The use of reading is anonymous access = enabled specific user = IUSR On one side of the original settings for the site, the Test Settings button is called 'OK on authenticity', but the authority does not verify access to the path. can.' In IIS 7.5 this has changed from being an IIS_IUSRS account to being a user under IIS AppPools www.mysite.com If you create an application pool, then the sites are created by default by the user account IIS Appul / www.mysite.com The following is a "security resource" for the Microsoft Doc / P>

imagemagick - Limit number of threads in IMagick (PHP) -

When using ImageMagick, I can set a fixed limit for memory usage and maximum number of threads. To do this, I know as far as 3 ways: Use an order "-limit memory 128MB original.jpg new.jpg Convert" Line options like " < Li> Use the "MAGICK_THREAD_LIMIT = 1" environment variables To change the default value of the 'policy.xml' configuration file. I have tested each of these methods using the "convert-list resource" and they work. Now, I have to use the IMagick extension in PHP. There is a function I can use to set the range: bool Imagick :: setResourceLimit (integer $ type, integer $ range) The first parameter I can use one of the following: Imagick :: RESOURCETYPE_AREA (integer) // MAGICK_AREA_LIMIT Imagick :: RESOURCETYPE_DISK (integer) // MAGICK_DISK_LIMIT Imagick equal to: RESOURCETYPE_FILE ( Integer) equal to / / MAGICK_FILE_LIMIT imagery: RESOURCETYPE_MAP (integer) // MAGICK_MAP_LIMIT equivalent to imagery: RE

ruby mechanize: how read downloaded binary csv file -

I am not very familiar with the use of Ruby with binary data. I downloaded large local CSV files to my local disk I'm using mechanics for Then I need to search these files for specific strings. I use save_as method in the mechanize to save the file (which saves the file as binary). The content type of the file (according to mechanization) is: application / vnd.ms-excel; Charset = x-UTF-16LE-BOM From here, I'm not sure how to read the file. I tried to read it as a normal file in Ruby, but I Get binary data. I tried and tried to use standard UNIX tool (strings / GRP) to search without any luck. When I run the 'File' command on one of the files, I get: foo.csv: Little-Endian UTF-16 Unicode Pascal Program With very long lines with text, CRLF, CR, LF line terminator I can see the data is just fine with cat or V. I also see some control characters with Vi I am I have tried both the CSV and the sharp CCV Ruby Library, but they get the 'IllegalFormatEr

iphone - UITextView highlightedTextColor or similar option? -

मेरे पास एक कस्टम UITableViewCell एक UILabel और UITextView इसमें जब मैं उपयोगकर्ता UITableViewCell को हाइलाइट करता है तो मैं इनमें से दोनों के लिए टेक्स्ट सफेद दिखने चाहता हूं। यह स्पष्ट रूप से highlightedTextColor को UILabel सेट करने के लिए बहुत आसान है, लेकिन UITextView में ऐसा कोई संपत्ति नहीं है UITextView जब भी सेल हाइलाइट हो जाता है / उजागर हो जाता है या क्या यह पूरा करने का एक आसान तरीका है? धन्यवाद! इसे मिला और मैंने सोचा था कि यह बहुत आसान था। बस UITableViewCell setHighlighted विधि का उपयोग करने की आवश्यकता है। - (शून्य) सेट हाइलाइटेड: (BOOL) हाइलाइट किया गया एनिमेटेड: (BOOL) एनिमेटेड { [सुपर सेट हाइलाइटेड: हाइलाइट किया हुआ एनिमेटेड: एनिमेटेड]; यदि (हाइलाइट किया हुआ) {[self.myTextView setTextColor: [UIColor whiteColor]]; } और {{self.myTextView setTextColor: [UIColor blackColor]]; }}

c# - Get Client IP address:port (System.Runtime.Remoting.Channels) -

I have a client IP address & amp; I got the port for internal storage. However, it is more than just the need to catch the customer's IP address and amp; Harbour. Are there any other ways to do this? There is very little reason to believe that it should be easy. Remotting works on TCP, HTTP and IPC channels. The transport system has been leveled away so that they do not get in the way of using remoting. For a TCP channel, the actual socket is managed by the TCPCLxtacet Yesler and TCPPSARSerhardler classes. They are internal sealed classes in the NAT framework, you can not get them from your code. The code in the linked post seems to me right, this framework is a direct copy of the code. I advise you to try it.

css - prevent centered text from moving when sibling is hidden/displayed -

We have a div that acts as a horizontal title bar with a title in between "settings There is also a left supporting link named "" that appears only when the mouse is on the title bar. The problem occurs when the settings link is displayed, the title moves. An example / w follows jQuery - How can we keep the headings of watches stable, even if the settings are displayed or not ? & lt; Script type = "text / javascript"> $ (function () {var settings = $ (".settings"); $ (". Titlebar") .mouseover (function () {Settings.css ("display", "inline ");}) .mouseout (function () {settings.css (" display "," none ");});}); & Lt; / Script> & lt; Style type = "text / css"> .titlebar {text-align: center; Width: 300px;} .know {float: left;} .settings {float: left; Display: None;} Title {margin-right: 10px;} & lt; / Style> ... & lt; Div class = "titlebar">

Is OOP worth using in PHP? -

There are many debates on whether object-oriented programming is good or not. However, the use of OOP in PHP is slow. Will it be a good business for procedural programming and slow speed and OOP use (since classes have to load a page every time and bigger websites start slow). More importantly, whether it is good to wrap the material inside a class and use a stable work, or would it be better to lie with the prefix: wp_function (). Yes, this is almost always a good idea to use OOP. This is because OOP is a style of coding, and coding styles for the most part are easily able to move into languages. People do not use coding styles because they use a certain language, people use coding styles because the style of coding provides good ways of doing things they feel Are desirable. Therefore, as long as there are original elements (heritage, class properties, etc.), it will always be feasible to write in that coding style. No, the use of procedural tasks to reach them is proba

android - Problem creating AVD -

I have installed an Android SDK on my Mac OS X 10.6 and there are many problems in creating AVD. < Ol> When I tried to create it for 'ECLIPES (3.5 Gallileo), after clicking on the' New 'button, when I try to write a name, a message says that' Goal selection There should be an avid 'but the problem is that, the goal field will become inactive Is obtained. If I'm trying to create ADD with the terminal, then './android avd - target2 --name my_avd' shows an error by saying 'error: after global parameter Expected action but instead found 'avd'. I do not know what to do now, can someone help me in this regard ?? Thank you Before you specify the Android SDK installation folder in the Eclipse Android Plugin Go to Preferences -> Android and set it up then you will have to install the targeted versions that you want to develop. Go to AVD Manager -> Available packages and download the target you need. After that you shoul

Is there any way to make a date object in 12 hour mode in javascript -

हाय, मुझे 12hr मोड में दिनांक समय बनाना है यानी 23 जनवरी 2010 1:30 पूर्वाह्न Java script ठीक है, आप हमेशा getHours () पर एक आवरण का उपयोग कर सकते हैं और 12 घंटे प्रारूप। दिनांक.प्रोटीटिप.टाहोर्स इन 12एचआरएमोड = फ़ंक्शन () {var h = this.getHours (); यदि (एच == 0) 12 रिटर्न; वापसी (एच & gt; 12)? एच -12: एच; } उपयोग करने के लिए एक अच्छी लाइब्रेरी है यदि अधिक अनुकूलन की आवश्यकता है।

algorithm - How do you determine the best, worse and average case complexity of a problem generated with random dice rolls? -

There is a picture book with 100 pages. If the dice is rolled randomly to select one of the pages and has been re-recorded for the search of a particular picture in the book - then how do I get the best, worst and average case complexity of this problem Decide? Proposed Answer: The best position: the picture is found on the first dice roll The worst case: the picture is found on the 100th dice roll or The image does not exist Average case: The figure is found after 50 dice rolls (= 100/2) Perception: Incorrect images are searched at a time Looking at your description of this problem, I do not think your assumption Picture only once "search "Is) is correct if you do not make that assumption, then the answer is shown below. You will see that the answers to the questions you offer are different. It is possible that you can succeed on the first attempt. Therefore, the first answer is 1. If you were unlucky, you could roll the wrong number forever. Then t

c# - How to create a single executable file in Visual Studio 2008? -

I have created a Windows Form Application in Visual Studio 2008, .NET 3.5. Now I want to finalize my project, i.e. one To create an exe file that I can give to anyone and it will be able to run it on my computer. In my project files I found the bin / debug directory where I see the .exe file. Can I use this file in the same way, or am I missing some important finalization process? Thank you! You can only take EXE as long as it has no dependencies if there are any DLL files , You need to include them (or use them to combine them) You can ignore any generated PDB or XML files. As a side note, if you are planning to deploy your project, you should compile it in release (output will be bin / release in )

database - Transactions in Castle ActiveRecord + NHibernate for dummies -

I want to do all of the following in a single nuclear transaction: Read through ActiveRecord One object from Save a new object via ActiveRecord Update another table through NHibernate In addition, if I By ending the transaction, the value of the item I read in step 1 has changed, I would like to overturn the transaction. I have never used the transaction in AR or NAH, so please provide more details as you can. How do transaction mechanisms play together? Well, the castle activate depends on the NHibernate, the truth is, a castle activist transaction class is found on NHibernate Is not the same; But you should think of ActiveRecord as a wrapper on one of the NIHBennet. So there is no need to "play together". Because, in depth, they are the same. Another important concept is "session". A "session" is a unit of work, a "window" that tells NHibernate what you want to do: questions, updates, and so on. Again, there is also a N

c# - Arduino serial monitor and java resets variables -

I wrote a small app to turn on an LED light connected to my Arduino board. The app sends a certain value to a specific byte value on the LED and to turn it off via the USB port. The strange thing is that when I use the serial monitor to turn the LED into the Ardino development environment and turn off the serial monitor, I turn off the LED without inputting the right byte value, also My Java Test contains the app What puzzles do I have that in my C # app I can send the LED in the right byte price and then turn off my app and the LED is still running. I'm totally confused why this is happening. From the description of Arduino Uno: Other implications of this setup When Uno is connected to either a Mac OS X or a Linux running computer, it resets every time through a software connection (via USB). If you are using C # under Windows, the board does not reset on USB connectivity. I think you run Java on another platform.

unboxing or toString() is used in sysout in java -

We know that when we use it internally in the sysout (System.out.Println) statement, this string The method is called. And prints directly with the primitive. But when we use objects in a wrapper class type, it is considered to be used: integer I = new integer (10) System.out.Println (i); Is it responsible for printing (unreading) or unboxing? A quick test and debug run shows that print (object) Applies, print (int) no. A good way to check is: integer value = null; System.out.print (val); If UN-Boxing was used, then it would throw a NullPointerException. It does not happen, however, this prints the string null , which is the output of String.valueOf (object) when a blank elapses. Another factor to keep in mind is that PrintStream exists before Java 5. It could be ensured that when AutoBoxing was introduced in Java 5 That the PrintStream will not change his behavior suddenly, so to call any existing code to print, , suddenly its behavior is print (i

process - Calling PHP multiple times within a CRON job (self-calling until an exit condition is satisfied) -

I plan to synchronize 2 folders to 2DIFIFERS servers that are every hour . The script to be determined, will check whether the previous example is already running or not, and if not, then continue with processing. So, the first step is to sync these folders. Daily (or more often), the second server will have 1-2 thousand new files, which must be first transferred to the server and processed. Processing will be controlled by PHP, it opens every file, reads each line and adds it to a database. What I want to do is use the same cron which sends folders to call php scripts to parse files. But since I do not know how long it will take to take action on many files, I want to apply a limit on the number of files handled by PHP on every request. For any PHP scripts (number of files / each request), if it has not been added, it can easily reach one timeout. The question is: Is there any way I can keep looping and call this PHP script until this process is finished? Ideally when

c# - Get posted selected item from DropDownList in ASP MVC -

नियंत्रक सार्वजनिक कार्यवाही बनाएँ () {वापसी दृश्य (नया पृष्ठदृश्यमॉडल ()); } [एचटीटीपी पोस्ट] पब्लिक एक्शन रिजल्ट बनाएं (पेज पेज) {try {repPage.Add (पेज); repPage.Save (); वापसी पुनर्निर्देशित करेंएक्शन ("संपादित करें"); } पकड़ {वापसी देखें (नया पृष्ठदृश्यमॉडेल ()); }} PageViewModel सार्वजनिक वर्ग PageViewModel {सार्वजनिक पृष्ठ पृष्ठ {get; सेट; } सार्वजनिक सूची & gt; टेम्पलेट & gt; टेम्पलेट {प्राप्त करें; सेट; } निजी टेम्पलेट रिपोजिटरी repTemplates = नया TemplateRepository (); सार्वजनिक पृष्ठदृश्य मॉडेल () {पेज = नया पृष्ठ (); टेम्पलेट्स = रीपटेम्पलेट्स.गेटअल्प टेम्प्लेट्स ()। ToList (); }} मेरे दृश्य के भाग & lt;% @ पृष्ठ शीर्षक = "" भाषा = "सी #" मास्टरपृष्ठफ़ाइल = "~ / दृश्य / साझा / साइट। मेस्टर" इनहेरिट्स = "सिस्टम। वेब। एमवीसी दृश्यपेज & lt; वेबसाइट.मॉडल्स.पृष्ठव्यूमोडेल & gt;" & Gt%; & Lt;% = Html.TextBoxFor (मॉडल = & gt; model.Page.Name, नया {@style = "width: 300px;&

architecture - Agents in minority games: inheritance hierarchy, pluggable behaviour through interfaces or some pattern? -

I am currently building a library to allow various minority games to be simulated. It involves the selection of agents between two options, say, A and B, then selecting the primary function of an agent is an agent wins a point for a turn in the game, if it is selected after all the agents, then the minority group Ends in. Obviously, a unique number is different in ways that an agent examines the effect of the strategy to make different choices on the overall wealth of their choice and game system. In some ways I need an agent to be able to choose: Completely random is being supplied with the memory so that they are the last M minority This memory is being used as an investment in strategy mapping for predicting minority preference and by promoting many other agents of 'friend' of that agent and then Everyone Selects Gent based on certain conditions, it does rely on her friends or not. Now for the programming problem I currently have an abstract agent that contai

python - Google App Engine and Django templates: why do these two cases differ? -

I am new to Python, and to help create a simple blog, Google App Engine I am using. I have the following test code: entries = db (Entry) .der ("- published"). Get () comments = db.action (comment) .order ("published") .get () self.response.out.write (template.render (templatePath + 'test.django.html', {'entries': entries , 'Comments': Comments,})) And it looks like a DJ ango template: {% "master.django.html" } Expanded {% block pagetitle%} test page {% endblock pagetitle%} {% block content%} {% for entries in entries} & lt; P & gt; & Lt; A href = "/ post / {{e.slug}} /" & gt; {{E.title | Part}} - {{E.published | Date: "js o \ f fy"}} & lt; / P & gt; In {% Endfor%} {comments in comment.all%} & lt; P & gt; {{C.authorname}} {{c.published | Date: "d / m / y h: i"}} & lt; / P & gt; {% Endfor%} {% endblock content}} When I look at this templated page in

chmod - Graffiti CMS - do I really need to 777 the entire install? -

I'm trying to install GraffitiCMS on my rackspacecloud account. It's mostly working, but it seems that I have to set everything for 777 to work? Is it also reasonable? Unless I am a security expert, it seems that basically the door is open to everyone in the world, this is not a great solution. Am I the misconception of graffiti? If this is really needed, can this product be considered as a viable option seriously? Depending on this version, Graffiti CMS and Grounds on the surface of your web server did not have the URL The directory and default .aspx files are written to support (i.e. mysite.com/post). Permissions for this account are required to be written / modified, which is running as the root of your site on your app pool. Usually this is a network service account. You do not have to allow anyone to allow the elevate. However, if you are using the latest Open Source version of Graffiti CMS on CodePllex and IIS 7.0 or above, then this URL uses routing and n

Converting equations to java for android? -

I am a cameraman and I want to make an app for my Moto Droid which is my depth in the field of four inputs Will calculate. I'm really new to JavaScript and this programming material, so I was thinking that someone could help me. I have a very basic GUI that I use a drawer that allows me Focus (@ + ID / Fuel) Focal Length (@ + ID / flip) ) Aperture (@ + ID / APT) Illusion Circle (@ + ID / COCT) For this calculation the equation For example For example ... I want to get the hyperfocal distance: ((f ^ 2) / (N * c)) + f All of these variables are ready with input in the GUI But I do not know how to call them, how to write the actual mathematics, and how to address the results, so that I can reveal them in the "result area" below the screen. I have never done Java before and I only want to make this app because existing people are not in my needs. Can anyone help? Thank you! If I'm not mistaken, for the creation of the XML User Interface

math - How can one check for "safe" conversions between value types in .NET? -

Back to the basics ... For reference types, someone can do this: / P> Some Objects Some Objects = First Object As SomeType; For price types, I understand that we have built-in conversions (no data loss), clear conversion (if there is a risk of data loss), Convert class (I think of a "conversion clipper") and also type-specific conversions (like double x = double.Parse ("2"); ), but I There is nothing similar to the operator as . So, my question is: What framework does some methods / operators / techniques to do something with these methods: if (! CanConvert (someValue, someValueType)) // // Beware! Data loss may occur} and {// there is no data loss} If not, then what kind of a Canconvert method to build concrete Can suggest the approach? Thanks a lot! Edit (1): The user-case / problem is as follows: Looking at the some given by the code user (my second itself, but it is irrelevant), (1) Check that some is a number (easy enough) a

JNI FindClass java.lang.ClassNotFoundException -

I am currently writing some JNI code to call a class within my JAVA program. I have successfully done it in a steady way within a class already. Currently, when I use it: jclass proc_jclass = env-> FindClass ("Example / io / struct / JavaClass"); This crashes JVM: java.lang.ClassNotFoundException. & Lt; Init & gt; (Ljava / lang / String;) V + 3 I have already tried to define class path locations, there is no benefit. Thanks I got the answer. This issue was resolved by moving the FindClass directly down the JNIEXPORT method. As IllGarly has said that NV pointer may be due to modified. It was removed in this way, the way it was avoided. Given the code it is still unclear what the problem is, but when I came to know that the sick report has come back. Apart from this, the top tip uses a variable I.e: env-> FindClass (str_class); Str_class was used to define squared paths so that you can quickly test what is accessible without combinin

.net - Is there a CASPOL.exe GUI command line generator? -

Image
Is there a simple utility / GUI application for the creation of CSOPOL commands? I am posting this solution when I think that I had this mini-headache as a net cas Has solved with. After searching for a CAS permission in the morning, I was trying to find a simple GUI utility which would allow me to generate the Caspol.exe command, and upgrade them to Vista / Win 7 Mode. Since I use this tool, I am getting it to recover myself, I need this every time I need it. Then, after making one, it seemed that I would share it to other people who could find it useful. Simple Little WinForms app, available at the following link. < / Div>

iphone - MPMoviePlayerController - streaming works on 3GS, not on anything pre-3GS -

I'm having some serious issues and annoyances with MPMoviePlayerController . In my app you can see trailers for some movies in .mov format. I have tested with a friend and users have reported that this does not work on their device, all of which are 3G. I have tested myself, a 3GS and playback works fine. I tried on the 1st General iPhone and it does not work. So I believe this is a memory issue, and it is only stopping the playback and is returning to the previous screen. Below I am using the code to launch the player, from the movie player example to Apple. MPVPlayer controller * MP3 = [[MPVPlayer controller ALLOCK] INST WITH CONTENT URL: [NSWR URLWithString: trailerURL]]; If (mp3) {self.moviePlayer = mp; [MP Release]; [Self. Play Movie Player]; } I have tried to check the NSERRR from the notification, but the only thing I get is " localized description and unknown playback error for both" Happened "Code> Localized Recovery Suggestions , it is i

Assigning Each User a Unique 100 character Hash in Ruby on Rails -

I have a form on a website that takes some personal information from the visitor, passing this information into another service And I need to assign to each of these forms that 100 characters have unique hash stored in DB with records. What is the optimal way to generate this key and to ensure that it is unique? It is fine that the main auto-pay increase ActiveSupport :: SecureRandom.hex (50) < P> The chance of not being unique is astronomical. Optional Simple "Not Scale" race condition failed solution Class MyModel & lt; ActiveRecord :: Before Base: Create: Assign_order_token private def assign_unique_token self.unique_token = ActiveSupport :: SecureRandom.hex (50) unique_token? End df unique_token? Self.class.count (: conditions = & gt; {: unique_token = & gt; unique_token}) == 0 and end if you actually are sure Make a unique index on the column, and by re-trying to handle a DB specificity error, similar to my implementation above.

parsing - Text Parser with PHP, like Instapaper -

I'm trying to write a text parser with PHP, like what Instapaper did I want to do; Get a webpage and parse it in text-only mode. Getting web pages with CRL and strip HTML tags is easy. But there are some common areas of every webpage; Such as header, navigation, sidebar, footer, banner etc. I just want to get articles in text mode and want to exclude all other parts. If I know "ID" or "class" information then it is also easy to exclude those parts, but I am trying to apply this process and apply for any page, such as Instapaper. I get all the content, but I do not know how to exclude headers, sidebars or footers, and only the main articles body has to develop the logic to get me the main article section. It is not important to find the exact code for me, it will also be helpful to understand how to separate unnecessary parts because I can try to write my code with PHP. This would be useful if there are any examples in other languages. Thank you for h

Capturing Web Pages in Adobe AIR -

I want to apply for a note Many times, I would like to capture completely / What part of web page can I do with Adobe Air? Can it integrate with browsers like Firefox? If not, I will use the integrated browser with AIR, but how can I capture on browser controls? It may be able to capture white flash and full / scrolling web pages. Sometimes I want to tag / comment on some parts of a web page. Is there a way to use HTML to add additional content to it? Unless you are doing this for a practice, you

iphone - Creating and canceling an NSURLConnection -

I have an NSURL connection that is working fine when I allow the load to complete. But if the user hits the back button, which means that the webview will disappear, I want to turn on the NSRR connection. But if the webview call is made in this scene, then the viewwiki is called Dissepier, and then I do: [cancel] I get an NSINValidArgument exception . Connection is defined as example data in .h file: NSURLConnection * conn; Async has been started here: NSURLRequest * request = [NSURLRequest request with url: [NSURL URLWithString: articleURL]]; If ([NSUrCon Connection Connection: & Requestable) & amp; Accessible) {// Set an Asynchronous Load Request = [Request with NSR Connection Connection: Request Rep: Auto]; LoadCancelled = NO; If (Kon) {NSLog (@ "Article is RSS !!!!"); Self.articleData = [NSMutableData data]; }} You will be the reason for getting the exception that you are saving an autorrietary object For an example variable. "Cone&q

delphi - TComponet / any other Superclass and its child item detection -

I have popup menu control on the form (grr, I most likely have it dynamic - hate device static) . It has got items with Submenu Submenu has three menu items (TMEIITIM class). I will have to check with the sender param and I..then if the process has been called by item or submenu items with any submenu. I tried different vraiations with typecasting and superclass operations but no luck. I think it is possible to do something like this: if FindControl (MenuItemWithSubMenu.Handle) = TControl (Sender as TComponent) Then parents ... But of course, with the right typecasting and command Any idea was appreciated. Additional information by community request: The code looks like ITSF (if I want to support through a component number): Process TForm1.xClick (Sender: Tubect); // If the process that is linked to PopupActionBar1 starts with item ((TComponent (Sender) .name = 'Unloadresources1') or // PopupActionBar1.Items [3] (TComponent (Sender) .name = 'VKPCach

Is it possible in Silverlight to stream a live video screencast of the desktop? -

I would like to develop a web conferencing system (or web class) as a graduate project / Which is a Java applet. I do not know what is possible for Java applets to perform on PC, it is also possible for Silverlight, or more restricted to SLL. There are two functions (which are related to me) iVocalize which I would like to include in my SL application, which are: A participants have a live desktop Broadcast the video stream to other participants so that they can follow all the activities done on the computer. A participant can take a snapshot of the desktop If the first functionality is not possible in SL, then do you think WPF can be used instead is? Thank you very much. Actually, you can use the silver light 4 webcam features With Silverlight 4, you can develop full-confident Silverlight apps that users can capture snapshots of the desktop.

How do I use obtainStyledAttributes(int []) with internal Themes of Android -

So I've looked around and found that android.R.styleable is now part of Although SDK is still documented here: It will not really be an issue if it is clearly documented that what is optional, for example, the AOSP Calendar app is still android.r.styleable < / Code> //. Get the dim sum from the theme type ARE A = get styled properties (com.android .internal.R.styleable.Theme); Lp.dimAmount = a.getFloat (android.R.styleable.Theme_backgroundDimAmount, 0.5f); A.recycle (); How to obtain from then Strong> Get background .R.styleable.Theme ? What do I have to do to get the STYLEEVITS (ATF []) to work with SDK? The Customview API Demo shows how to get styling properties. Here's the code for the view: The StyleLabel array is defined in the section here to get the text, color and size: You can use to define any list of attributes that you want to retrieve as a group, in which both the platforms defined by the platform are themselves an

iphone - NSArray sort and isolate -

I have an NSArray of names, I want to sort them in alphabetical order in a UITableView and separate them into sections. I am I have a tag block, section 0 at the top. I want to solve the names aplhabetically solve. So all the part 1, B, starting with the name of all, put it in section 2, and so on. I should be able to get the number of rows for each section by any means, and then each section of the objects How do I do this? You probably arrange an array of arrays, one for each letter, and store your names in the same way When you use an array for storage , there is no fast way to do that partition you are looking for. Sorting, sure, but not section-ization.

java - Red5 RTMP Streaming -

I am very new to RTMP streaming and am looking for help. Just enough for me to start I've been Googling for about 5-7 hours and still can not set my answer! Red5's documentation is limited and it can not be supported at all! My similar questions are unanswered at Staxahovarflow: ( My questions are: Why can not I just keep one. In the server root of MPR Red5 and run it? To serve a simple MP3 file on RTM. Do I need to write a Java application? If so Any sign? < Post-text "itemprop =" text "> What is the easiest way to do the Odela demo? Start your Red 5 server and go to You select "Offload Demo" and install it, if you do not already have it installed, then the next location is available on your MP3 or later. Whatever the place in the place % RED5_HOME% / webapps / oflaDemo / streams will be the Red5 Home Directory where you have installed Red5. So if you have used the installer It can look like this: C: \ Program

ant - Netbean RCP Dependency build -

I am using NetBean RCP to develop my desktop application. My goal is to use "cruise control" for overnight construction. I can not find any information about all Java sources (all containing the Netbeen module). I also want to be able to define it. For example, if, for example, org.openide jar is missing, then it will be D-L as its requirement. I have 2 questions: Can I run IDE automated build outside of Netbeans IDE? How can I define internal \ outer reliance for my project If you want to stick to the ant or you can use it, you can use it

Rails observe_field using jQuery -

What is the same as the Rail / Prototype Inspection Method using jQuery without jRails? I'm doing a Will-Pagnet with a search-like-like-type: 2,: update = > 'Result',: loading => "element.show ('spinner')",: full => "element. Hide ('spinner')",: url => {: controller => 'afoo': action => 'Search'}, with => "search = '+ escape (value)"%> To use jQuery, you will need to use a selector, something that should work $ ("#search"). Show bands ("blurred", function () {$ ("#spinner"). Show (); // spinner var form = $ (this). Parents ("form"); // Hold the search bar wrapper Var URL = form.attr ("action"); // Hold the URL from the action value of the form. Var formadata = f orm.serialize (); // form $ .get (url, formdata, function (html) { // Find an AJAX, get the data in it, the subsequent work is done to get a successful job. $ (

data binding - winforms synchronise combobox values -

I am trying to synchronize the selected level of a comb box when navigating through the records. Setting up Cumbabox The selected work does not work. I have tried to refresh Cambodia, but that too is not working. Combibox is the figure. If your combo box is data-bound (i.e. you have set up your datasource property correctly) , Then you also need to make sure that its DisplayMember and ValueMember properties are set to the correct areas.

php - Codeigniter and jQuery css switcher -

I'm following on creating a style switcher with PHP and jQuery, now the PHP function gets the data in the tutorial , Which is not available in the codiginator, I was hoping that someone might be able to clean my attempted apology? My PHP function function setBackground () {$ style = $ this- & gt; Uri-> Segment (3); SetuKi ("style", $ style, time) + (60 * 60 * 24 * 30)); Echo $ style; } My HTML and jquery calls & lt; Ul id = "options" & gt; & Lt; Li & gt; A class = "option" href = " jQuery plugin jQuery.fn.styleSwitcher = function () {$ (this) .click (function () {loadStyleSheet (this); Details Is false;}); Function Loadstyle Sheet (OBJ) {$ ('body'). Append ('& lt; div id = "overlay" />'); . $ ('Body') CSS ({height: '100%'}); $ ('# Overlay'). CSS ({Display: 'None', Position: 'Full', Top: 0, Left: 0, Width: '100%', Height: 

java - How can I get SQL Sever Tables to appear in Reverse Engineering Wizard? -

I am not doing much Java coding, so I am not very familiar with NetBusiness IDE. I am trying to create a reverse engineering file based on a SQL Server connection established in my Hibernate CFFX. The reverse engineering wizard does not show any tables while viewing the configuration file. I have not received any error. I believe that the configuration is correct. I suspect that I may need to change the database schema. Can someone tell me what is happening or I get a signal for some documents? thanks I have a Vizio reverse engineering I suggest suggesting the facility - he has worked for me in the past.

mapreduce - Hadoop searching words from one file in another file -

I want to create a houp application that can read a word from a file and search in another file. If the word is present - it must be written in an output file if the word does not exist - it must be typed on any other output file I tried some examples, I have two The questions are Two files are about 200 MB Checking each word in any other file can be out of memory Is there an alternative way of doing this? How can the data be written in different files, because while shortening the stage of the hoop only writes a file, is it possible to have a filter to reduce the phase of data writing in different output files is? Thank you. How can I do this? In the words 'map' In the divided value, emit (& lt; word>, & lt; source>) (* 1) You will find in 'less': ( , & lt; source list> ) Check the source list (may be long for both / all sources) If all the sources are not in the list, then each time (& lt; missingsource>, &

iphone - Why is NSFetchedResultsController not correctly loading section titles? -

I am using NSFetchedResultsController with a UITableViewController. I have created a transient field in my core, the name of the data model area to use as a label for my UITableView sections is "section index" in my application, in a "client" unit There are many "jobs" (many more than 1) - so to get my related job groups known by their respective "client" (through section). I apply this method to my code base as a category on the 'job' unit @implementation job (TransientMethods) - (NSString *) sectionIndex {NSLog ( @ "JobWrapper.Job.sectionIndex .:% @", Self.client.name); Return self.clit.name; } @end and the string "sectionIndex" sectionNameKeyPath as the argument is sent in the init method for NSFetchedResultsController I wipe the app from the simulator - The application runs for the first time, the job of the job retrieves the front page correctly and lists jobs according to the section index method

javascript - When the last insert table row is deleted, the width of second cell of first table row became 0 -

I am sorry that I can not find the correct title of my problem. I wrote a simple web page and some javascript in which the table The row of was inserted and it was removed. Now my problem is that when I delete the last inserted row, the second cell of the first row row width becomes zero in IE6. Can someone give me some advice? & lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Script type = "text / javascript" & gt; Function deleteRow (r) {var i = r.parentNode.parentNode.rowIndex; Document.getElementById ('mytable') deleteRow (i). } Function insertRowInTable () {var table = document.getElementById ("myTable"); Var lastRow = table.rows.length; Var newRow = table.insertRow (last time); Var i = 0; (; I & lt; 9; i ++) for {var td = newRow.insertCell (-1); Td.innerHTML = "" + i; } NewRow.insertCell (-1) .innerHTML = &

c++ - App looking for an invalid dynamic library -

I'm getting several error windows for an app that I Ask me _libpal_bullet.dll When it should actually be just libpal_bullet.dll The strange thing is that when I receive all the error messages, the app uses the right DLS in the same directory. The tax runs. How can I get rid of these errors? You can use the code to see the steps that brought the call to DLL . Perhaps you have ._libpal_bullet.dll included in your release configuration.

winforms - Windows Forms ListView in Details Mode - How to Change Row Height in Owner Draw? -

I have control in the list view details of the Windows Forms. There are several columns in the play. I am trying to attract the boss to make a "detailed" detailed call "below" of others. Therefore, instead of: COLUMN1 COLUMN2 COLUMN3 COLUMNNNNNNNNNNNNNNNNNNNNNNNNNN4 I am trying to: COLUMN1 COLUMN2 COLUMN3 COLUMNNNNNNNNNNNNNNNNNNNNN4 How can I not understand how to enlarge borders Any ideas of items to fit the room to attract the column given below ? All rows in a list view should have the same height You can get a long row that fonts Fit fits more than one line of text, then the document is using a small font in event handler. If it is very binding, then you have a datagram view or a custom third party component.

How to build an order processing form in ASP.NET MVC and jQuery/JavaScript -

I need help building a page where information is placed on a form at the top of the page and then in the grid below Forms are added when the user clicks on the "Add" button, the form will have drop-down boxes, so in the grid that represents the selection, the columns will display the drop-down text, not the Index / ID. Once all the data has been entered (many lines in many other rows) the data is stored on the server for processing. Ideally all edits and data should be recognized on the client, i.e. with javascript / jquery and once submitted on the server second price relevant button clicks / grid There will be AJAX call on server to add / edit / remove line items on selections. I will still need to maintain data on the server for a special session. I am using ASP.NET MVC 1.0. And I'm using a telegram MVC grid in other parts of the site, so it would be good if I can stick with it - but not necessarily: -) and a noob with javascript / jquery. Thanks a lot!

c++ - WCF service with Qt? -

I want my Qt application to expose a service. Is there any help in Qt to implement WCF services? There is no 'native' QT support for AFAIK WCF or extension; However, as you know, WCF can consume a web service (other than WCF or Remoting Service etc.) and expose it, what you have to do to expose it as a web service to another NAT app Need But it brings an interesting aspect; Normally you will write a Windows service (I think you are on Windows) which has come up as QT one web service instead of one. Qt is not ideal because it is a GUI framework (and very good); You will be involved in some interesting situations, as is usually easier to consume a web service with Qt. Do you have the option to use some other stacks like ASP.Net or WCF or Java?

html - IE7: Flash playing in hidden divs :( -

The landscape inside has a bunch of divs with flash content; Clicking on the menu will show these flash divisions filled / hidden I have problem IE 7 plays these divs before I "show" them. Many thanks in advance, LNV. Just one thought: when you view Div's visibility (with Javascript) If you modify, then maybe you can set your Flash embed element? Something like this: & lt; Script & gt; Function showflipflopdiv () {someDiv = document.getElementById ("flipflopdiv"); SomeDiv.style.visibility = "visible"; SomeDiv.innerHTML = '& lt; Object width = "[...] gt; '}}

sharepoint - Required Field InfoPath -

Can you make an information path attachment control mandatory based on the criteria set? If the list selected selected value is high attachment is not mandatory This form will be in a SharePoint form as a web based form < / Div> No, you can not change the mandatory support changes on Build because it depends on the XSD Schema < P> But you can not only make your fields mandatory and then add a data verification that They do not allow the list box to be empty if the list is high

svn - How to mask delete on files in Subversion -

I am trying to set up a subvarnage repository with Apache httpd, everything looks good so far. But a major constraint I'm experiencing is the use of the rights for the files plane and painful. Any legitimate user needs to access RW access to receive and edit the file. There is no provision to cover the delete option on file. A user who accesses the RW, may deliberately or accidentally destroy a file in the repository which is a danger. I'm not sure how good the hook script is, with eclipse in the eclipse client, I have a provision to browse through the archives and delete the file. How do I stop it, or can I use the files better in SVN archive? Please share your thoughts thank you. If people (i.e. "read" privilege) enter your repository Amendments (i.e., "write" privilege) , it seems that they can also delete files - that is any kind of amendment. However, whatever is possible in your SVN repository, it is always possible to revert any amendmen

php - Choosing Last Node in SimpleXML -

I want to find the property of the last node in the XML file. The following code is the attribute of the first node of search. Is there any way to find the last node? foreach ($ xml-> gig [0] - & gt; Attributes () as the $ id) {} ​​ Thanks < / P> > foreach ($ xml- & gt; xpath ("// gig [last ()]") [0] -> property ($ id)) {}

removing an element from multidimentional array php -

I'm trying to remove an element from a multi-dimensional array in PHP. Here's the code: & lt ;? Php $ tset = "ST3"; $ Gettc = "gettingtc1"; $ Getbid = "gettingbid1"; $ Getresultsid = "MillingId1"; $ User [$ tset] = array (); $ Users [$ tset] [] = array ("testcase" = & gt; "$ gettc", "bilded" = & gt; "$ getbid", "resultsid" => "$ getresultsid"); $ Tset = "TEJ"; $ Gettc = "ggettingtc2"; $ Getbid = "gettingbid2"; $ Getresultsid = "Horserid 2"; $ Users [$ tset] [] = array ("testcase" = & gt; "$ gettc", "bilded" = & gt; "$ getbid", "resultsid" => "$ getresultsid"); $ Tset = "ST3"; $ Gettc = "ggettingtc12"; $ Getbid = "gettingbid13"; $ Getresultsid = "gettigresid14"; $ Users [$ tset] [] = array ("testcase"