Posts

Showing posts from January, 2013

PHP function won't execute when called -

I'm having trouble with this function. It is supposed to echo out some stuff, but for some reason when I I do not call it. Here is the function: $ count = count ($ info ['level']); Function displayInfo () {for ($ i = 0; $ i & lt; $ count; $ i ++) {echo "[b]" $ Info ['name'] [$ i]. "[/ B] \ n \ n" $ info ['level'] [$ i]. "\ N Value:" $ info ['price'] [$ i]. \ N Sealback: ". Info ['sell'] [$ I]." \ N Location: ". $ Location". Type \ N \ n: $. Info ['type'] [$ i]. \ "Element:" $ Info ['element'] [$ i]. \ NDamage: "$ info ['damage' ] [$ I]. "\ NBTH:". $ Info ['bth]] [$ i]. "\ N \ nSpecial". "Hit \ N:" $ info [' hits'] [$ i]. "Type \ N:". $ Info ['stype'] [$ i]. \ NElement: ". Info $ [Sealement '] [$ i]." \ NDamage: "$ info ['sdamage'] [$ i]." \ NBTH: "

arrays - Is there a Perl shortcut to count the number of matches in a string? -

मान लीजिए मेरे पास है: मेरी $ string = "one.two.three.four "; पैटर्न को मैच (3) मिलते समय की संख्या प्राप्त करने के लिए मुझे संदर्भ के साथ कैसे खेलना चाहिए? क्या यह एक-लाइनर का उपयोग कर किया जा सकता है? मैंने इसे करने की कोशिश की: मेरी ($ संख्या) = स्केलर ($ string = ~ /। / Gi); मैंने सोचा था कि कोष्ठक को $ number के आस-पास रखकर, सरणी के संदर्भ को बल देता, और scalar के उपयोग से, I गिनती करना हालांकि, मुझे जो भी मिलता है वह 1 है। यह regex को itself में डालता है स्केलर संदर्भ, जो कि आप क्या चाहते हैं नहीं है इसके बजाय, regex को सूची के संदर्भ में डालकर (मैचों की संख्या प्राप्त करने के लिए) और उस को स्केलर संदर्भ में डाल दिया। मेरी $ number = () = $ string = ~ /। / / G;

Are jQuery() and $() aliases? -

I understand that $ () is a shortcut for jQuery () The nickname is but then I read what they are two different things? EDIT: Thanks for the answer. Why is there no consistency in the document, which uses $ () for the most part, then switch to jQuery () in the UILights section? That's why I confused myself. No, you were right. They are nicknames, what the doctor was trying to say was to choose something that runs on the cover of jquery, resulting in: $ (some) .each (function (). .}); There is a separate function on a bare object (whether it is $ or jQuery : former> $ Each (some, works () {...}); which can be applied to any adequate array-type sequence, not just jQuery wrapper objects < / P>

xcode - A Leak in Apple's iPhone project template? -

Today, I tried to fix a leak in my newly created iPhone app. After some searching, I have found that there is a leak in the applet's tab bar application template. Did you know, or am I wrong? It was found that the application leaks in simulator only, not on the actual device, whether you are on an iPhone or iPod touch. Can you see leakage while driving your app? If this happens only in the simulator, then I'm not worried.

Setting Flash (AS3) variable with Javascript -

How can I set up a Flash (ActionScript 3) variable using Javascript? Or is it possible to call the flash function with javascript parameters? I have tried the document.getElementById ('Flash'). Set variables ("data", "asdf"); But it only works in AS2 and AS1. Here are the basic things: Step 1: Create a function in the Flash that sets the variable: function setVar ( Value) {somevar = value; } Step 2: Use ExternalInterface to register the function: Var connection = ExternalInterface .addClallback ("some function name", blank, set); To set up the variable, call Step 3: by javascript to your function: var mySWF = document GetElementById ("swfID"); MySWF.someFunctionName ('some_value'); If you are using swfobject to embed your swf, then one more easy choice will be the adwircle method: mySWF.addVariable ( "Var_name" "value");

syntax - F#: always "unexpected 'when' keyword" -

The VS2010 beta 2f # compiler always complains about the use of keywords by me, even when copy -Pip code is also used to work, for example, for example, I get this error when trying to execute a very trivial expression: "Error FS0010 : Unexpected keyword 'when' in expression. Expected '-' 'or other token. " For i [1..50 in i & lt; 10 - & gt; I] --------------- ^^^^ You want for [i in 1..50 if i The 'short' syntax was deleted with 'short time'. See "Compact Sequence Expression" in that document.

c# - Is anyone doing visual debugging with Jint? -

I am using server-side javascript code to run and I like it very much. One issue I am doing is debugging. GINT exposes events that can make statements when a statement is executed or a breakpoint hits, it is possible to create a visual debugger that works through this mechanism . Before I am changing the wheel again, has anyone done so far? Are there any structures, libraries or tools that can facilitate the process? This is actually something Sebastien (coordinator) and I (a developer who helps her) about this Thinking: Though the debugger working in Visual Studio, we have not made a premium on this, maybe you should try to ask directly on the discussion board at the codeplex.

types - Python: TypeError: 'float' object is not callable -

I am trying to get involved in 2 strings using this code: Def __get_temp (self): return float (self.ask ('rs') def __set_temp (auto, temporary): set = ('ss' + delegate (temporary)) stat = self.ask (set) returns self Check (stat) temp = property (__ get_temp, __set_temp) Together, I send a signal on a serial bus using PyVisa, however, when I try to call the function I get the traceback (the most recent call final): file "& lt; pyshell # 4" gt; Line 1, & lt; Module & gt; Chil.temp (13) TypeError: The 'float' object is not worth the corner I have tried to look around for the details of this error, but none of them have any meaning is. Anyone know what is happening? It seems that you are trying to set properties temporarily, but do you really do Are getting assets and then trying to call it as function with parameter 13. The syntax for setting is: chil.temp = 13

Set a path variable with spaces in the path in a Windows .cmd file or batch file -

I'm new to scriptwriting and can not get it to do one thing. If I have moved the files on the path without any space, but I want to work it with space, if it can be possible I have a folder with a .cmd file in Office updates Want to get a bunch To make the batch file usable on any computer, I have set a path variable, which I have to change to run only on one machine in another place. The problem is that there is a place in it on the way. If I put quotes around the path in the definition, then cmd.exe keeps them around the path before they add file names and switches and fails with the batch "command line syntax error". Without the quote, it fails, "Internal or external commands are not recognized as operative programs or batch files." To test, I am using the help switch until I can get it working. I can do this using the file / folder name (like my document as MyDocu ~ 1), but can it be done in a different way? Try something like this: SET MY_PA

vb.net - import excel to sql db table -

I am trying to write data from Axle Spread Sheet in the SQL database. I'm able to connect to Excel spreadsheets and read data, but I'm unable to get data to be inserted into the SQL DB table. The current code is as follows Any help most appreciated. Dim plmExcelCon System.Data.OleDb.OleDbConnection as the slow ldExcelDS system. As Data.DataSet dim cmdLoadExcel as System.Data.OleDb.OleDbDataAdapter Dim PrmPathExcelFile string PrmPathExcelFile = txtImportFileLocation.Text.ToString plmExcelCon = new Prnalikdeta. OleDb.OleDbConnection ( "Provider = Microsoft.ACE.OLEDB.12.0; Data Source =" + PrmPathExcelFile + ", Extended Properties = Excel 12.0,") cmdLoadExcel = new System.Data.OleDb.OleDbDataAdapter ( "[+ txtImportSheetName.Text + "$]", plmExcelCon) ldExcelDS = select new System.Data.DataSet * "cmdLoadExcel.Fill (ldExcelDS) dgvImportData.DataSource = ldExcelDS.Tables (0) plmExcelCon.Close () cmdINSERT.Parameters (" @ [SQL Col

c++ - Random bytes with fread -

#post My variable names are not impossible! This code will be removed when it works! #post OK, so I'm using Fred in stdio.h to read a text file. The problem is that I keep reading random bytes which are not present in the text file with my knowledge. I am assuming that they are part of the file scheme but I have to make sure that this is not my code. #include "stdafx.h" #ifdef WIN32 #include & lt; Io.h & gt; #else #include & lt; Sys / io.h & gt; #endif #include & lt; Fcntl.h & gt; # Include & lt; Sys / types.h & gt; # Include & lt; Sys / stat.h & gt; # Include & lt; Stdio.h & gt; #include "n_script_timer.h" // using namespace std; #ifdef _INC_WCHAR typed wchar_t CHR; #Else Tidefe four CRR; #endif int _tmain (int argc, CHR * argv []) {#ifndef _DEBUG if (argc == 1) {printf ("You must drag a file to this program to run it."); Scanf ("% * c"); Return 0; } CHR * fname = argv [1]; # ALSSE

mysql - Local connection with Database -

How do I add my local client application to the database on the server? I am using Delphi and MySQL By adding RageZ response, depending on your comment: Do not have a close IP address, a machine name or a UNC path name, you do not know where the server is, so you will not be able to connect it. You will need to type the some type if you can enter the server, then you should be able to get your address. Is it on a web host or something? Do you have to go through the firewall?

iphone - how to find if push notification certification is wrong? -

I want to know how I know that my push notification certificate is incorrect. I am devicetoken on my device but no information is found. Follow the steps described here, (or apply the function to capture the error in your code ) And read eroor. The example code here will tell you if the certificate is incorrect. The article also notes this in the article.

c# - modifying text in Editable Pdf files -

I am working on a project and I want to edit the data in specified areas by editabble pdf File using the C # program. I'm not familiar with editable PDF files and am amending the program data using C #. Is any C # open source API available to fill editable PDF files? Thanks nRk is a .NET library that features other features With this allows you PDF form.

asp.net - how to sort repeater according to any content? -

Hello, I have an asp.net application where I am getting value from twitter and this data is bound to a repeater. I column name is "rate" where the user can rate with the star rating. I am not accumulating these values ​​in any database. I want this functionality, when I click on rate it will sort the repeater value according to the star rate without evaluating This is already asked (and answer) the same as the question. Check out this post: I will read the articles given in the first reply and will run from there.

Why java has fixed data type size unlike C -

In C , as we know the size of the data type (eg compiler / hardware. But why is the type of data type continuously in Java's language? Why is there no flexibility in different types of data type in Java based on the compiler? < Div class = "post-text" itemprop = "text"> JVM (Java Virtual Machine) is designed to be platform independent if the data type size is in the platform Cross-platform stability is sacrificed. JVM separates the program from the built-in OS and platform. It can make life difficult for system-specific work, but profit It is that you can write-run once, anywhere (this is true to a great extent, with some unfortunate issues. Write-once, trial-everywhere is a more practical approach).

php - Css/images/javascript in codeigniter -

Regarding the post, I want to add css, images and JS to my cognitive applications. My question is, when you add a path to your header file href = "& lt; php echo base_url () ;? & gt; css / moorainbow.css" , then where do you actually get your files What is it, in the system, application, view or controller? I have been able to explain this kind of process as 10 articles, but no one is saying that where should the actual file be kept? Can anybody help me with this ? Thank you , which means that you have to keep CSS files at the same level of the system, whose Meaning your webroot Not inside the system in the web root, inside the app, etc. Read more from the website.

Django model property geo distance -

I am trying to apply the proximity search based on latitude and longitude using Django and Postgresql. I have an abstract version of the model. Class items (models.Model): "" "Dossstrings for items" "uuid = UUIDField (primary_key = true, auto = true) name = model.carfild (_ (" name " ) = = Model = _Keyfield (_ ('location'), max_length = 40, and the address = Blank = true, null = true) @property def geo_distance (self, location = none): if the location is nothing: cursor = connection.cursor () cursor.xicute ("SELECT geo_distance CAST ('% s')) POINT , CAST ('% s' AS POINT) "% self.location, location) return round (float (curse) .itchin) * 1.621371192237), 2) I want to be able to do something like this, such as view.py: items = Item.Abject.Filter (name__istartwith = "anything") Results = [] Items in items for: results.append ({'name': item.name, 'distance': item.geo_distance ("(11

Getting webpage content with Ruby -- I'm having troubles -

I want to get content from this * page. What I have seen is the solution to parse CSS elements; file = file.open ('http: // itscore .runescape.com / index_lite.ws? Player = zezima', 'r') content = file. Contains content Error: Tracker rb: 1: In 'Start': Invalid argument - http://hiscore.runescape.com/ (Errno :: EINVAL) from index_lite.ws?player=zezima tracker.rb: 1: from 'tracker.rb' in Open: 1 * http: // itscore .runescape.com / index_lite.ws? Player = zezima Try to format you In this post it does not recognize the underscores (_) in the URL for some reason in a link As After the you actually want to use open () available by the kernel class read from the URI requires 'open-yury' file = open ('http: // h Iscore.runescape.com/index_lite.ws?player=zezima') content = file.read content It relates to the same thread, the same question The Bridesmaid:

How do I create Perl module templates for more than one module in the same namespace? -

I use templates for my Perl module. Unfortunately, I was not able to explain a "clear" way to create a family of related modules and their documents and test suit templates at one time and all are great for building a one-off module such as all others. is. Obviously, whether A: P, A :: Q, A :: R: h2xs or other starter tools is possible in a single invitation, or even A: Q, A :: R has been created once for a :: P template? module-starter can be implemented as such, a single invitation To create all modules in: module-starter ---- author = 'example author' - email =author@example.com --module = A :: P - module = A :: Q - Module = A :: R - Destro = 'MyA-module-Destro'

html - Arbitrary table of key/value pairs in a <meta> tag. Any open standard? -

Is there an open standard (microformat 'ish) that specifies an arbitrary table of keys / values ​​in an HTML meta Does the tag exist? So we say that I have a website about Color, and there was a page about a 5-color palette. I essentially want to express the information shown in the page, in a format that can be messed up by third party services. In this situation, there are five colors to make the palette. Like it: & lt; Meta name = "data" content = "color1: '#ffff', color 2: '#ffaff', color 3: '#ffffff', color 4: '# 00fff', color5: '# 00ff00'" /> I can roll my own specialty, but I really hate doing so if there is already something present there. There is no need to contaminate the web, which is already a shade of shady standards ... (PDAs know very well about RDF. I want to specify content in the page .. and there is no need to load another document for data only.) Also open & lt; Meta &a

Why does Visual Studio only allow one link per file in a project? -

I have to file a solution in many different projects, however, Visual Studio allows only one link Update strong> I described the comments given below to the file Link has been added, it seems that this issue is on a per project basis. There can not be many links to the same file within the project. When I try to add a link, I get the following error - "There is already a link". One project can not contain more than one link for the same file. "I am using Visual Studio 2008 Professional, and it allows the same file to be soft from one project. Each other is connected to the project, independently of the number of solution files you are using. / P>

file upload - How can I create an image object from an FileUpload control in asp.net? -

I have a FileUpload control. I am trying to save the uploaded file (an image) and also saved several thumbnail copies of the file. When I try to do something like this: System.Drawing.Image ImgOriginal = System.Drawing.Image.FromStream (PhotoUpload.PostedFile.InputStream); I do not have a "System.ArgumentException: parameter valid." I also tried to use PhotoUpload.FileBytes to create an image from file bytes instead of InputStream, but the same error occurs. The uploaded file is a JPG. I know that this is a valid JPG because it saves the original fine. EDIT: This code really works. The parameter is not valid PhotoUpload.PostedFile.InputStream was empty ... which seems to be a totally different issue. It seems that after uploading my original file the file is uploaded. EDIT: It is learned that InputStream of a FileUpload can be read only once / and once it is consumed and then it is finished. To get around I uploaded the file and saved the file byte in a by

database connection - How to connect vb.net to wamp server? -

Do you know by any means how to add wampserver or phpmyadmin localhost to vb.net, Searching, deleting, updating, listinging data from localhost database via vb.net? Huge tutorials about VB.net and MySQL: VB.net and Short Tutorial about MySQL:

flash - XML/SWF help needed -

I want to apply a little SWF application to use it on my XP desktop location. And if I want to run the films directly from this SDF, then I need to parse parameters such as movie name and subtitle name in button link. And I thought if I could flash all the data and parse that button link - from all the data (1db .avi, .mpeg etc. and other .srt, .sub files) - of Use: SWF to see all movies on your desktop and control with my remote control. Does anybody know how can I put all the movies and subtitles addresses in an XML file? Note: My database is very large, it has no chance of inserting all the manuals. So I need a button, like if every time a new movie is added, refreshing the XML file. > You must use a server-side language to dynamically create your XML files, so they do not need to be physically present , Nor do you need to update them. How to keep subtitle information inside an XML file, there is no problem: XML does not care what you will do with those content, it

java - Android Videoview video not seen -

I am using VDOV for playback MP3 files from local machine using Android emulator. I've heard the audio, but the screen is empty and no video has been seen. Android SDK 2.0.1 Does anyone know what's missing in: package com.hello; Import android App Importroid.os.Bundle; Import android.widget.MediaController; Import android.widget.VideoView; Public Classroom Hello Android Activity Extends (Override Public Zero on VideoView vv; @Create (Bundle Saved InstantState) {Super.Nocrat (Saved Instantstate); setContentView (R.layout.main); VV = (Video See VVBiID (RID Video Power 01); Media Controller NC = New Media Controller (this); vv.setMediaController (NC); vv.setVideoPath ("/ sdcard / yu.mp4"); vv.requestFocus (); vv. Start ();} Pause public at zero () {vv.stopPlayback ();}} Eg xml Android; Watch Video Android: ID = "@ + ID / Video Visual" Android : Layout_width = "wrap_content" Android: layout_height = "wrap_content"> &

Java: How do I perform list operations with different definitions of equals? -

Java: How do I handle the list with different definitions of equal? For example, if my POJO had the following structure: Public Class Generator Pojo {Private string ID ; Private string address; Private string city; Private string country; Private string extra; description; } (with the appropriate getters and setters) List1 & gt; Generic Pojo & gt; and List2 & gt; GenericPojo & gt; , How do I know: List 1 - list 2 (where generic pie class is the same if only id is the same) list 1 and Cutting 2 list (where id , address , city , country , but extraDetails < / Code> is genericPoO similar) Can two different custom comparator classes be helpful here? Is there a library that handles these tasks effectively or should I try to implement my own? If you have to manipulate the class outside your control, I will suggest using the delegation. Try: Rich list list contract Single method `Public boolean equivalent (TT1, T, T2) for appl

c# - Update requires a valid UpdateCommand when passed DataRow collection with modified rows -

I am using the following code to update the rows in the database table: < Code> MissioniDataSet MissingDeset = New Ms.DateSet (); Missionary Diary Adapter MissionDiraiable Adapter = New MisdiitableTableAdapter (); MissioniDiarieTableAdapter.Fill (missioniDataSet.MissioniDiarie); Forward (Missionary Dataset Missionary DataAssetMishini Diary.Row) (Eye Diarrhea = Decimal. Purse ((Textbox) Page. Font Control ("Import" + Eye diarrheaed)). Text;) I.AccontoMax = Decimal .Parse (Textbox) Page.FindControl ("acconto" + i. Diarrheaide).);} MissionIditionalAptactor Update (Miskindetacet Mascindirai); But when I run it I get the following error: Modified lines To pass the Detroe collection, a valid UpdateCommand is required. Why? How can I resolve this? itemprop = "text"> The error is quite literal and clear, the problem is with your adapter, it is missing an updated SQL statement You are using a Generated Adapter as an attempts to rec

python can't remove a file after closing it, "being used by another process" -

I am trying to delete a file after reading it, but receiving "WindowsError: [Error 32] Process file because it is being used by another process " file = for the line in the open (self.filePath) file: #do things file.close () os.remove (Self.filePath) # osrename throws error (self.filepath, self.filepath + "old") #throws only error any ideas ?? Update: I restarted the box (windows 7), started eclipse, moved to os.remove ("c: \ file \ file.txt"), ran my first line of script, and Found the same error. 2 UPDATE: I used Windows Explorer to navigate the file. For the first time I could not remove it, it was being used by "system". The second attempt was deleted. The correct file is no longer now. Now when I run os.remove ("c: \ file \ file.txt") WindowsError: [Error 32] Can not access the process file because it is used by another process Is being done: 'c: \ file \ file.txt' so I see Windows Explorer and the file comes

flash - Does FlashPlayer support ScreenVideo codec? -

I have an SDF file, which is an encoded movie with a screen code codec, SDF says that FP supports it , But I do not have any According to: This SDF According to the imagination does Which truth is real?

javascript - jquery, submit form when field loses focus -

field (in this case only one field) loses focus, how can I submit a form? I tried to do this, but it is not working: $ ("form"). Submit (); UPDATE I also forgot that the form was also created with jquery: $ ("Div"). Html (' This is probably why it will not submit, I think that these incidents are not being seen. Loses the focus of the field when triggering the event's event You can add an event handler to its address You can apply. $ ("# field"). Blur (function () {$ ("# form"). Submit ();}); If there is an ID in the field or other means of easily identifying (which I would recommend), then you can do anything like this: $ ("#form: input"). Blur (function () {$ ("# form"). Submit ();}); Because there is only one field.

java - How to make an Eclipse debug launcher that launches a Class -

I am trying to create an Eclipse Launch Configuration, which I can launch programmatically, if you wish Can create custom debugger I already got a org.eclipse.debug.core.launch configuration type extension, as well as .core.launchDelegates , < Code>. Ui.launchConfigurationTabGroups and .core.sourcePathComputers extensions. I have a button that executes the following code: ILAnchManager MGR = debug plugin.gate default (). GetLaunchManager (); Type Alok Configuration lct = mgr.getLaunchConfigurationType (IOpcodeConstants.LAUNCH_CFG_TYPE); Alok Configuration [] lcs = mgr.getLaunchConfigurations (lct); (Int i = 0; i & lt; lcs.length; ++ i) {if (lcs [i] .getName (.) Equals ("opcode")) {lcs [i] .delete (); break; }} ILAnch Configuration Working Coord wc = lct.newInstance (blank, "opcode"); Set up & lt; String & gt; Mode = New Hashet & lt; String & gt; (); Modes.add (ILaunchManager.DEBUG_MODE); Wc.setModes (mode); Wc.setPreferredL

mscorjit overlaps mscoree when using windbg -

लोड हो रहा है डंप फ़ाइल [C: \ Crash_Mode__Date_12-05-2009__Time_15-54-2727 \ पीआईडी-4056__CCNET.EXE__1st_chance_Process_Shut_Down__full_13d0_2009-12-06_00 -33-14-734_0fd8.dmp] उपयोगकर्ता मिनी पूर्ण मेमोरी के साथ फ़ाइल डंप: केवल आवेदन डेटा उपलब्ध है टिप्पणी: '1st_chance_Process_Shut_Down_exception_in_CCNET.EXE_running_on_TEST218' प्रतीक खोज पथ है: SRV ई: \ प्रतीकों < / em> निष्पादन खोज पथ है: विंडोज सर्वर 2003 संस्करण 3790 (सर्विस पैक 2) सांसद (2 procs) नि: शुल्क 64 उत्पाद: सर्वर, सूट: उद्यम TerminalServer SingleUserTS मशीन नाम: डीबग सत्र का समय: सूर्य दिसंबर 6 00: 33: 14.000 2009 (GMT + 8) सिस्टम अपटाइम: 32 दिन 12: 43: 52.414 प्रक्रिया अपटाइम: 0 दिनों 8: 44: 37.000 .......................... चेतावनी: mscorjit ओवरलैप mscoree .. ............................ चेतावनी: wldap32 ओवरलैप डीएनएसएपीआई .......... चेतावनी: रसापी 32 ओवरसीज डीएनएसएपी ... चेतावनी: टैपिओ 32 ओवरलैप्स रसापी 32 < / P> । चेतावनी: rtutils overlaps रस्मान .............. चेतावनी: s

java - What's an efficient algorithm to make one list equal to another one? -

Assuming I have a List A that should look exactly like a list. All the objects of B are but A does not have to be added to A and A has all the objects, but there are no b, they should be removed from A. I need a reason for this because I have an ArrayList of players, I save a file every time when I update the attributes of a player, then I save the changes to the file, Which calls a method that looks at the player's ArrayList and saves it, it works because the names of the Arrivites are references. However, whenever I search for a player in the list, I read the file and update the list where it is stored. It changes all contexts with all new objects after doing so, if I change the user brought in earlier and try to save it, I have changed the new instance of the player in exchange for it. To create a list equal to any other solution, you have to come up with a good algorithm? Or is there a better way to update the entire list while keeping references in using it? Update

xna - Collision Handling Between Circle and Line Segments -

I am implementing a small game and I am having difficulty working physics properly. In this game, a ball (a circle that runs from frame to frame, can change radius) and many walls (line segments, which change from frames to frame and increase) I properly detected the collision I can not, and there is no problem bouncing the ball in the right direction. In such situations, by piercing a line in one frame by piercing the balls, then again it takes a hole in the later frame, due to a double bounce, I can take the ball back with normal Unless it is in a valid state, but it is actually a cause of weird behavior when the line in question is being hit with its axis (a ping pong ball is an honest toothpaste suddenly abruptly toothpick Moving aside one side ...) There are also some issues when the ball holes more than one line in a given frame (the idea of ​​making a rectangle with four rows together with the rectangular corner gaps Do) - In what direction should it bounce? In which direc

ruby on rails - How to add a class to a render :partial => @collection on every 4th item? -

Assume that I have 16 results On every 4th item I got a class " Margin "(because on the left one margin is required to make each item different, but the last time this will break the layout, thus its requirement). What is the best way to do this? / P> I have this very rail-like. Render: partial = & gt; @ Collection__collection.html .html Accessories Is there anything I can keep partially that will solve it or will it be excluded? Thank you. When you present a collection, the rail creates hidden indices. In this case, You can add the module with the index to get it. # _partial.html.erb Even better, remove the logic in a Helper method. Note. Counter's Name & lt; Partial_name & gt; _counter .

python - How to pass items as args lists in map? -

This is a piece of my code, Lembda accepts 3 parameters, and I assign them them as Tupal of static arguments I want to, but apparently, map provides them as an argument. How can I supply those Tulips as a list of logic? (I know I can re-write Lambda, but it will not be well readable) plus = map ((Lambda J, F, A: J. Jensen ([ Parse.options [a]] for f.format (i) if parse.options [a] else ''), (('', '-not-path' {0} "',' exclude ') , ("-or-", "-path" {0} "',' include '))) Try to keep the legs around them plus = map ((Lambda (J, F, A): j.join ([f.format (i) Parse.options [a]]] if parse.options [a] else ''), (('', '-not-path' {0} "',' exclusion ('-a', '-path' {0} "',' include ')))

Is there any kind of documentation available for Silverlight.FX? -

Silverlight FX It seems that it will cover my MVVM needs, though I do not know anything about behavioral system (or any good doc) Except for blog posts which are from previously released versions Specifically, I am trying to explain how I can capture a RowCommit event from my perspective and on my visual model Can I apply a method / event? I am trying to capture this phenomenon with the ComponentOn datagrid, but there is nothing in the framework, it indicates that it does not work with third-party control. Any thoughts? I really need to write some docs ... partly expecting a reference sample See sample applications that are right - they're all compiling / working, and displaying different scenarios. Your Specific Question ... Note I have not seen or seen the control of that particular seller ... but some educated guess: & Lt; / Fxui: Interaction.Triggers & gt; & Lt; / ComponentOne: data grid & gt; You can pass through data from events - for exampl

javascript - How to call a method in class from its replaced implementation? -

, I'm trying to understand some concepts in JavaScript. Consider the following code: function person (name, age) {this.name = name || "no name"; This.age = age || "Age is not specified"; This.printStr = function () {console.log ("& lt;" + this.name + "," + this.age + "& gt;"); }; } P = new person ("Pranav", 26); P.printStr = function () {console.log ("This works .... even .... ...." + this.name); }; P.printStr (); I want to call the 'printStr' implementation in the person class from within the 'printStr' function implementation in 'P'. It should do that the output is required: Any thoughts? :) The way your code is now set up, you can not do this. When you call person as a constructor, the object that is going to be p is set to this . So when you define printStr in the constructor, then p gets a property named printStr . When you assign another func

java me - Peek() and remove() methods for Queue implementation in Blackberry -

I get QQ of Java and Qi. Like the Rev (), I want to apply and remove the pickup application in Blackberry. I have a custom queue implementation, but how do I get to peek at the elements and remove the elements from the queue? Please help, Thanks in advance. Try to use the class ... if you want to peek, remove the last one For, take the last element from the object array: / P> class queue {private object [] amelments = new object [] {}; Public Zero Enqueue (Arrays.insertAt (Milements, Element, 0); } Public object dequeue () {object result = zero; If (empty! = Amelments & amp; amp; amp; 0; elements.lamp) {result = amelements [amelments. Length - 1]; Arrays.remove (meillements, results); } Return results; } Public Object Peek () (If (Zero! = Mealments & amp; MTELMant.Lamp) Measures [Milements, Long-1]; And Faucet Return;} Public Zero Extract () (If (Zero! = Milements & amp; ; Amp; amp; amp; amp; mlx lamps) Arrays.remove (amelments, peak ());}} using the ex

performance - C# fast crc32 calculation : -

I have published my application with ants and found that> 10% CRC 32 is in the calculation (CRC 32-Count is done in plain C #) I did some Googleing and learned about the following internal insights in Visual Studio 2008: _mm_crc32_u8 _mm_crc32_u16 () () Can anyone tell me how to replace them with my home page CRC32? C be? Not sure that you have to use those methods to change the decoction of your home for one Got good implementation.

compiler construction - Does this grammar allow scope nesting? -

I'm only able to work in the global field. Scope nest means being able to work within the job is correct ? I am not able to do this with this grammar, is it possible? / * C-Minas BNF grammar * /% token ELSE% token if% token INT% token returns% token void% token WHILE% token id% token NUM% token lte% token gte% Token EQUAL% Token Notices %% Program: Announcement_list; Declaration: Declaration declaration_list | Declaration; Announcement: var_declaration | Fun_declaration; Var_declaration: type_specifier id ';' | Type_specifier ID '[' NUM ']' ';' ; Type_specifier: INT | Zero; Fun_declaration: type_specifier ID '(' params ')' compound_stmt; Params: Ultimate_list | Zero; Param_list: param_list ',' Ultimate | Ultimate; Ultimate: type_specifier id | Type_specifier ID '[']] '; Compound_stmt: '{' local_declarations statement_list '}'; Local_declarations: local_declarations var_declaration | / * Below

DataGrid reference is NULL after event was dispatched -

I'm a total flex novice and I struggle with the event model. I have the following scenario: DataProvider is set to ArrayCollection The data grid is a simple two-to-do list, checks in the first column as check junk Other columns are plain strings What I need to achieve is that after creating or starting a data grid, I have the color of the item renderers The style must be conditionally updated. The situation says, if the value of the property (stored in the data provider) is correct, then set the color of the text to gray. The problem is that the item renders are initiated before the data grid is created, so the data grid reference that I can get in the item renderer is null. That's why I informed that the item renderer after data grid has been completed. The question is how to use the Flex Event Model. It seems that the event items sent by the data grid were not heard by the renderer Please take a look at my code: When I start my application and the da

java - Hibernate Criteria, Integer and "like" -

I am migrating some of my certain HKL-statements to Criterias. Now I am finding a problem: unit property Type is integer, but I need a way with wildcard searching, so in hkl I session.createQuery ("id from p1: id"). SetString ("id", "%" + s + ex> string can not be entered for integer criteria crit = sessionFactory.getCurrentSession ( ). CreateCriteria (P1.class); crit.add (Restrictions.like ("id", s)) addOrder (Order.asc ("id")) setMaxResults (maxResults) .. < P> Why does hibernate handle both situations differently? You can use. It has no meaning. str where like string (id: id "). SetString (" id " , "%" + S + "%") if your If it is not near then it will be quite slow column.

regex - making graphs with a shell script -

Image
I need to create a graph with numeric values ​​in a time period, the value shows online users in a web page . The script will be exectued with Cron in every 30 minutes and the required HTML file will be downloaded with wget. But there are some unanswered questions yet & amp; Problems: -i needs to get only numerical values ​​from the html code (but grep gives the whole line), how can I get only numeric values? I can get a line with grep, it looks like: User Online: 24 917 & lt; / Div & gt; How can I get only 24 9 17? - What would be easier? To generate the .svg file with the graph, or save the values ​​in a .csv file (and generate graph with OOO or something similar). Maybe some other good ideas? Thanks in advance, -jpg or this: # Bash> = 3.2 (can be different for syntax 3.0 / 3.1) [[Line Line = ~ $ points]] num = $ {BASH_REMATCH [@] //} < P> In your question to remove the number from the variable $ line . Should be easily available

Affecting Single Element with jQuery -

What am I trying to do, when my function will be in user. Yale-Button then Yell-box-Txt will disappear. The only problem is that I have another button on the site and whenever I hover one of them, all the text fields will disappear. This is my job: $ ('.jell-button'). Hover (function () ($. ('.Yell-box-txt'). Remove ()}) Thanks in advance for your help < P> Without knowing your markup, D suspects that your .yell-box-txt will appear on your .yell-button in the same block. So for markup like this: & lt; Div & gt; & Lt; One class = "yell-button" & gt; Text button & lt; / A & gt; & Lt; Span class = "yell-box-txt" & gt; Text & lt; / A & gt; & Lt; / Div & gt; You want to use something like this: $ ('.jell-button'). Hover (function () {$ (this) .closest ('div'). ('.jell-box-txt'). Remove ();});

c# - How to make ContentControl listen to non-routed event inside its ContentTemplate -

I have some reusable content controls, which work in the second view as a pseudo-modal popup. It is always there and only its visibility is visible or disappears. Within ContentControl, there will be a custom content template, which is bound to some view modal and represents the content of "modal popups". & lt; Dialog: ModalDios DialogHost = "{Binding ElementName = Layout, Mode = One Time}" Content = "{Binding ViewModel.CurrentAditIT}" EyesShown = "{Binding ViewModel.IsInEdit}" & gt; & Lt; Dialog: ModalDialog.ContentTemplate & gt; & Lt; DataTemplate & gt; & Lt; Item Editor: Magnifier View / & gt; & Lt; / DataTemplate & gt; & Lt; / Dialogues: ModalDialog.ContentTemplate & gt; & Lt; / Dialogues: ModalDialog & gt; Now I want to reach the following: The root of ContentTemplate (here: item editor view) should apply the following interface. Public Interface ICLOS menu {event eventhand

vb.net - How Do I Use the app.config file with a Test Project -

I am using unit testing, to ensure that I connect to the ConnectStrings section of my app.config file I can read string information. It works fine in the proper application, but when I try to prepare a unit test for it under the test project, then the dll.config file is being ignored, and the machine.config file is connected to the contact information. Instead of being received. How can I make sure my test is read from the correct config file? Your exam project should have an App.Config file.

Singleton Logger in Java that can log which class the log method came from and log to multiple areas/machienes -

मैं संभवतः java.util.logging का उपयोग करना चाहूंगा यदि संभव हो, कोई विचार? धन्यवाद। आप प्रयास कर सकते हैं। सरल लॉगिंग जावा (SLF4J) के लिए मुखौटा जावा या (एसएलएफ 4 जे) के लिए सरल लॉगिंग मुखौटा विभिन्न लॉगिंग चौखटे के लिए सरल मुखौटा या अमूर्त के रूप में कार्य करता है, उदा। Java.util.logging, log4j और लॉगबैक, अंतिम उपयोगकर्ता को तैनाती के समय वांछित लॉगिंग ढांचे में प्लग करने की अनुमति देता है।

With Java: replace string in MS Word file -

We require a Java library to replace strings in MS Word files. Can someone suggest? Loading and then the most basic when supporting MS Word in Saveing ​​any file besides formatting might possibly correct the layout. You should try this though, maybe it works for you. There are also many commercial libraries, but I do not know that none of them is better. While working on this type of requirement, I was using the format recently to settle the dirty "solution", open the zip container, read the document XML, and then to my markers in the correct texts Was replaced with. It works to change the simple bits of text without paragraphs etc. Private static final string WORD_TEMPLATE_PATH = "word / word_template.docx"; Private static final string DOCUMENT_XML = "word / document.xml"; / *** / final processing templatefile = new class text processing (WORD_TEMPLATE_PATH); Final zip inputstream zipin = new zip intstream (template file.zestinputstream

What are valid Perl module return values? -

The common thing in Perl is that 1; End the module with so that the call can be checked for success, is there any reason why the return value can not be another real value? In my test, this does not seem to be the cause of any problem, but I would like to know if anyone has any issues (such as some other modules or prejs or some values ​​that are actually assumed on 1 And not just the truth). EDIT: By popular opinion, and because it will work only once (good tip), the code example has gone, the consensus is that it is safe to return any true value, But never calling in that value should not believe because requirement will return 1 after first loading I have been fooled at the end of my module for a while I keep things. There is no harm in it and it has a small easter egg "Yes, this code is a joke." There is a full crack in them. Take this one step further, sometimes when a function is returned to true and false i true I'll return anything oth

c - Problem writing array of doubles to a file -

I have a very large array of double exact numbers ... I tried to write fprintf () in a file ... I have to write one of these numbers in each row, so I did something like that. if ((fp2 = fopen ("temp", "w") == faucet) {false ("file can not be opened"); Exit (1); } For (int k = 0; k & lt; j; k ++) {fprintf (fp2, "% 0.3lf \ n", diff [k]); } However, one problem is that he writes data to a certain number after which I give all the zeros. For example 3.040 0.700 -2.740 0.000 0.000 0.000 0.000 0.000 0.000 I really can not understand what the problem might be. Why is all values ​​written as 0.000 when there are values ​​in the array. How does this differ here if it helps? diff = (double *) malloc (file size); Diff [0] = data [0]; For (j = 1; j; l & lt; n; j ++) {diff [j] = data [j] - data [j-1]; } Valid data stored from a file [] Then I calculated the differences of the adjacent values ​​in the data [] diff [] in the fil

c# - How to add button to textbox? -

I'm trying to create a text box with a button on the right my code: Public partial class text boxButton: text box {[category ("button")] [description ("button in text box")] Public button button {received {this.btn return}; } Set {this.btn = value; }} Safe Override Zero OnCreateControl () {If it contains. (This control is included. (It's .btn)) {This. Control. Add (this.btn); This.btn.Dock = DockStyle.Right; } Base.OnCreateControl (); }} Every time I start my API and set some text or image in the button then it's empty, some thoughts? Best regards. You must tell the designer that the properties of this button should also be sorted: < [Designer Serialization Visibility: Content] Public Button Button {// ...} The default is hidden, so any of the button properties are Designer Will not be written to the .cs file. The setting, say, works in text properties designer, but after losing the value of the property, you can start the app or r

iphone - sending message to viewController from the application delegate -

I'm new to obj c, I've come from an AS3.0 background. Basically I am making this app, I am using an application in an app representative. I have a navigation controller that comes with a table view that triggers on just selecting another view (basically the templates available in the xcode) I have one method in another view controller view that loads from the row selection My label will change there for "my incoming call" in that method (for now). Our application in our application is calling this method and it works fine, but I get a troublesome warning that the UIViewController may not be able to respond to incoming calls ... but it compiles exactly And answers it. How can I get rid of this warning signal? - (zero) Application Specialist Action: (UIAPPP * *) Application {NSLog (@ "Call Commune In"); UIViewController * vc = [Navigation Controller ViewView Controller]; [Vc handleIncomingCall]; [VC Release]; } Sorry, I am trying to figure out how to

data structures - Choosing among alternatives in a Haskell algebraic datatype -

प्रकार एक्स के रूप में परिभाषित किया गया है: डेटा X = एक्स {sVal :: स्ट्रिंग} | मैं {iVal :: Int} | बी {bVal :: Bool} और मुझे int एक एक्स मान के अंदर, यदि कोई है, अन्यथा शून्य है रिटर्नआईंट :: एक्स - & gt; Int मैं कैसे निर्धारित कर सकता हूं कि किस प्रकार का X तर्क returnInt है? डेटा SomeType = X {myString :: String} | मैं {myInt :: int} | बी {myBool :: Bool} इस परिभाषा में कोई एक्स, आई और बी प्रकार नहीं हैं I एक्स, आई और बी कन्स्ट्रक्टर जो टाइप की वैल्यू बनाते हैं सोमटाइप ध्यान दें कि जब आप उन प्रकार के कंसल्टेंट्स के साथ निर्मित किसी भी मूल्य का प्रकार है, तो आप क्या पूछते हैं, तो क्या होता है: * मेन & gt; : टी (आई 5) (आई 5) :: कुछ प्रकार * मुख्य & gt; : टी (बी झूठी) (बी झूठी) :: सोमटाइप वे उसी प्रकार से संबंधित हैं! जिस प्रकार आप एक्स, आई और बी का उपयोग कर सकते हैं प्रकारों का निर्माण, आप प्रकार को विरूद्ध करने के लिए पैटर्न मिलान का उपयोग कर सकते हैं, जैसे ऊपर अन्य उत्तर में किया गया है: returnInt :: SomeType - & gt;

reset - How do you get the current failure count for a windows service -

I have a service that will fail when some resources become unavailable. I have configured it to try to restart it twice, then send me an SMS on the third attempt. Unfortunately the window only gives you the option of resetting the number of failure after a certain number of days , while I actually want to reset it to every third failure. The problem is that once the service is running again, one more failure will cause it to not send another SMS and also try not to restart the service. Then I want to include my SMS script to reset some code failure counters. I have found the following registry location: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Which other things are included as far as settings for (Binary) failure tasks, but no As the counter I can tell. SC does not return a failure count, lets you query all types of stuff, but it also does. Ideally I would like to query a way to reset the / failing counter of the program after a command line or r

c# - send PrindDocument to another form -

I want to show the printDocument in another form that has been placed in the second way in print preview control. form1 public system. Drawing Printing Print documents document; form2 code private zeros form 2_load (object sender, eventArgues e) {form 1 form 1 = new form 1; PrintPreviewControl.Document = form1.printDocument; } I'm sure printDocument has a document to print in form1, but when form2 is loaded, nothing is shown on the print preview control. Should the method of the print document call in Form 1 before showing Form2? Your example should work fine, but PrintPreviewControl is only associated with print documents during the PrintPage event Is fed during. If you are not doing anything during the print page event, print preview will be an empty document. It is likely that if you put printproof control on Form 1, you will receive it same behavior.

transactions - Creating a "secondary ID" in mysql -

I have a table that stores "records" and is already a primary key Table A ======= ID (INP) PK Auto_Increate project_id (INT) record_text (TEXT) This table "records" for all my projects Example: If Project 1 had an ID of (1,5,8,9) , it is desirable to have a secondary key. As (1,2,3,4) will be desirable to store them and present them to the user. I do not have the ability to use the transaction and I have had difficulty in thinking in a way without doing so due to concurrent issues. Hopefully I get my problem clearly. Thanks in advance for the help. Edit (example): Assuming composition: ID, Project_ID, Record Text 1 Test 1 2 Testing 3 2 Testing - 4 1 Testing My ID will be 1,2,4 for Project 1 but I want them to be 1 as 1,2,3 Looking for a way to store and display> I can not tell from your question, but if you want to present a clean numbered list to the user; I handle it in the UI; And can not even worry about storing it in the databa

c# - Why is AppDomainSetup.ShadowCopyFiles a string? -

from: A string in which the string value to indicate that shadow is "true" "Imitation is on; Or "false" indicates that the shadow copy has been closed. And because of that 1.1 can anybody shed light? I have reflected the recipient and setter for good measure: public string ShadowCopyFiles {get this return.value [8]; } Set {if ((value! = Null) & amp; amp; (string.composition (value,} and {this.Value [8] = null;}}} // referenced value property ... internal String [] value {get (if (this._Entries == empty) {this._Entries = new string [0x10];} return it.}} Personal string [] _ ​​entries; Lesson "> Caffeine deficiency is not to understand certain things. This is clearly defined by NAT The first version can be a mistake because it can break the "legacy" code. God, I just got it: Your response to the .NET Framework Thanks for that! We believe that this is an inspection and the type of property should be Boolean. Howe

security - Silverlight and Full Trust Issue -

We are planning to create a new integration component that gives us access to the machine installed apps from our web site Could. The first word that came to me was ActiveX, but our expertise with technology was not the best in the past. Thinking a little bit, the work Silverlight also came on my head The question is: What is the one way that the Silverlight (2, 3, 4, whatever) What is the full dependable application from the browser? The link is appreciated. Filipe Unfortunately, no. Full trust is currently in beta, and these are restricted to the out-of-browser applications. In addition, full trust SL4 applications do not have unrestricted access to the system (especially the file system), although this can change edit: If you are considering ActiveX (which is Windows / IE only), then you can see it because it can run completely, trust the browser (if it's in a trusted area).

sql server - C# using list table and text file to execute SQL query then export -

Scenario: I have a list table coming from Cambodia that can contain up to 50 things listed in the list table (in the list box The listed list is the column name). Hard part: I have a text file that matches a field in the SQL table. X1, X2, X3 are the listbox items. So I basically need it: Select & lt; In the line text file & gt;, from & lt; Blah & gt; Where id = object_id ('table') export & lt; X2 & gt;, & lt; X3>, & lt; X4 & gt;, & lt; X5>, & lt; X6 & gt; C: \ Comma.text I do not need help listing catalogs, or SQL connections. Just basically how do I list my listboxes in strings (no matter what order was selected in that order, to match based on Textfile, the SQL command And export it to it.) I know that this is going to be a pain thanks to Advanice Your question is not very clear ... the primary key in the text file is the value for the rows in the table? If so, then your SQL proxy code will look lik

Where should I place my own "module" within rails application? -

Certain functionality looks better in my Rail application as if it was a different "module", which is is required. For example, suppose it is a function to calculate the Fibonacci numbers. The functionality is free on the rail application and can be reused in other projects, so this app should not be stored near the controller and the model, I think but since I did it in separate projects I'm not going to separate, so this does not look like the right thing by putting it into the seller folder. Where should I put it then? Instead of placing the reusable code as if it is in the lib directory You do not already have a requirement in the form of need in the form of lib and its contents will be loaded in the initial time. If you expand an existing class, you first define your module and then include it by sending that class as a message, which you want to extend, e.g. Module MyExtensions def self.included base base.instance_eval def my_new_method

python - Reasons for this disparity in execution speed? -

I wrote a quick python script to compare two files, each of which contained an uncashed hash, it verified To do that, both the files are similar to the order, then I write it again in Ruby for educational purposes. The Python implementation takes seconds, while the implementation of Ruby takes up to four minutes. I have thought that this is most likely for me lack of Ruby knowledge, any thoughts on what I am doing? Environment : \\ file1.txt ',' r ') for hash = dict () f.readlines () in line: if not in the hash row: hash [line] = 1 other: hash [line] + = 1 print " F.close () f = open ('c: \\ file2.txt', 'r') for the row in the full file 1 "f.readose (): if the swan is not in line: print" hash not found! " Has [=]: hash [key]! = 0: Print "Uneven hash count:% s": For the key in the hash, "file2" num_errors = 0 hash for print [line] - = 1 f.close () Print. % Key num_errors + = 1 print "% d match

iphone - SubViews not properly initialized using IB -

Using Interface Builder and I'm having trouble introducing yourself properly Sbwugh I have the following view hierarchy (UIWindow -> BlankCanvasView -> StalkerView) is BlankCanvasView is a sub-category is a IBOutlet of UIView and StalkerView BlankCanvasView @ interface BlankCanvasView: UIView { IBOutlet UIView * hunter; I have established a connection between BlankCanvasView and the subview hunter outlet. However, look at the black canvas method in my touch, the stoker outlet is zero. See below to touch. - (touches zero) brinjal (Anssiti *) touches with Avant (Uaiivent *) event {Anselog (@ "Touch launched !!!"); NSLog (@ "stoker example% @", hunter); [UIView Start Permissions: @ "Stoker Animation" Reference: Zero]; UIT * touch = [touches any object]; // Stallur is here Neil !!! [Hunter set center: [touch in the previous locationView: Self]]; [UIView commitAnimations]; } What am I missing? It seems that none of my demo apps are pr