dynamic

Batch Script - Create Dynamic Variable Names or Array in For Loop

£可爱£侵袭症+ 提交于 2019-12-24 00:16:45
问题 I would like to ask you if you can advise. I don't know if it is possible to create dynamic variable names in batch or array or something like this. For example set c=0 before for loop and then set c = c+1 inside for loop and use this number to create dynamic variable name inside for loop e.g.: set entry%c% = 'somestring' and afterwards use these numbered variables to print output outside for loop e.g.: echo %entry1% echo %entry2% Example: @echo off set /a c=1 for %%i in (list.txt) do ( set

Include menu on every page

寵の児 提交于 2019-12-23 22:51:16
问题 Let's say I have a simple CSS layout and my menu is a column on the side. This menu is going to be on every web page (About 10 web pages). If I have items on this menu in the form of links and such, how can I make it so that if I add a link on one page, it will add it to all pages? Would you just make it a PHP page and in that <div> element include a PHP file called menu or something, and just edit that PHP file (so I only have to edit that file and not every web page)? 回答1: If this is raw

Web Crystal reports produce Database logon failed

北城余情 提交于 2019-12-23 22:19:44
问题 I developed a Crystal report on my local machine and I can render the report on my local website using .ExportToHttpResponse but as soon as I move my code to the production server I get a "Database logon failed" error. I basically used a .XML dataset file as the source to develop the report locally. This was my code: I call a method to render the report: private void RenderCrystalReports(string rptName, string pdfReportName, DataSet dataForReport) { string reportPath = Server.MapPath(@"\App

How to setup onFocusChangeListener() on a dynamically created set of editTexts?

两盒软妹~` 提交于 2019-12-23 21:43:51
问题 i have this code in which i inflate a linearLayout containing 3 editTexts everytime an edittext of the previous lineaLayout loses focus. I want to have the onFocusChangeListener on the most recent created editTexts only. Instead, onFocusChangeListener is called only when the the first linearLayout loses focus and not the rest of others. protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sale

javascript: changing the name attribute dynamically

╄→гoц情女王★ 提交于 2019-12-23 21:36:52
问题 I have this script I'm working on and there's no errors on it but I want to add some functions on it like when I click the button it adds but I want the name attribute of the input text to be changed too. Here's my script: javascript: var a = 1; function add() { var fContent = document.getElementById('1'); var sContent = document.getElementById('2'); if (a <= 10) { a++; var objTo = document.getElementById('m'); var divtest = document.createElement("div"); divtest.innerHTML = (sContent

.htaccess dynamic imageurl rewrite

这一生的挚爱 提交于 2019-12-23 21:22:10
问题 I want to redirect all my product images to an external site using htaccess. However I cant figure out how to use dynamic variables, the image-url looks like this: httpz://localhost/oc1505/image/80x80-10035.jpg Where 80x80 is the height and the width, and the 10035.jpg is the link to the external image. So in this case I would like to redirect it to an url that looks like: httpz://www.othersite.nl/imgs/prd/ kln /10035.jpg how ever if the source image is 150x150-10035.jpg it should redirect to

Javascript Function to add/remove fields

天涯浪子 提交于 2019-12-23 20:48:36
问题 I'm not very experienced with JavaScript, but this code was similar to what I was looking for , especially where it includes the 'Remove Field' link. Here is the Javscript function: //Add more fields dynamically. function addField(field,area,limit) { if(!document.getElementById) return; //Prevent older browsers from getting any further. var field_area = document.getElementById(area); var all_inputs = field_area.getElementsByTagName("input"); //Get all the input fields in the given area. /

Dynamic Linq - String.Split

元气小坏坏 提交于 2019-12-23 20:15:39
问题 It appears that Dynamic Linq doesn't implement the String.Split method. Is there a way achieve the same results with Dynamic Linq ? 回答1: Dynamic Linq does support String.Split and also calling other .net type methods as shown below var query = db.Customers.Where("City.Split(\"abc\".ToCharArray()).Length == 1 and Orders.Count >= @1", "London", 10). OrderBy("CompanyName"). Select("New(CompanyName as Name, Phone)"); It was able to convert the string to expression tree but as SQL doesn't have any

dynamic call of functions and generator function (python)

青春壹個敷衍的年華 提交于 2019-12-23 19:27:55
问题 The following code only prints "good". Why the generator function is not executed? I noticed with pdb that after executing 'handlers1' the script reaches the line with f1's definition but then does not get inside the function. Conversely, it's returned 'GeneratorExit: None'. class foo: def f0(self, s): print s def f1(self, s): print "not " + s yield 1 def run(self): handlers={0 : self.f0, 1 : self.f1} handlers[0]('good') handlers[1]('good') bar = foo() bar.run() Why this happens? Is it

Odd behavior rendering dynamically type of input type checkbox Angular 2+

跟風遠走 提交于 2019-12-23 19:14:57
问题 Need: Create an input with the type attribute dynamic. Something like this: <input id="{{ field.id }}" formControlName="{{ field.code }}" type="{{ field.type }}" /> Use the above input with "checkbox" dynamic value inside a FormGroup (reactive forms). Problem: The problem comes when i set the type attribute dynamically and what it causes is creating the checkbox in the DOM with an attribute value="false" when i initialize the FormControl with false . Therefore the FormGroup never gets updated