Search Results

Search found 9122 results on 365 pages for 'dynamic scripting'.

Page 78/365 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Dynamic Virtual Hosts In Apache with www and non-www subdomains

    - by haukish
    I don't know apache very well and I've got a problem with configure mod_vhost_alias This is my httpd.conf file: UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <Directory /var/www/sites/> Options FollowSymLinks AllowOverride All </Directory> <VirtualHost *:80> CustomLog logs/access_log.sites vcommon ServerAlias *.domain.com UseCanonicalName Off VirtualDocumentRoot /var/www/sites/%1/ </VirtualHost> Subdomains work fine without www. but I need to make them work with www too. Here's an example: something.domain.com - site is loading www.something.domain.com - Not Found What should I do?

    Read the article

  • What are the reasons to use dos batch programs in Windows?

    - by DVK
    Question What would be a good (ideally, technical) reason to ever program some non-trivial task in dos batch language on a modern Windows system as opposed to downloading either PowerShell, or ActiveState Perl? To be more specific, I make the following two assumptions for the duration of this question: anyone technical enough to be able to write a medium-complexity batch script is technical enough to install either of the scripting interpreters. Neither of those two present enough of a learning curve for basic batch replacement tasks that said curve would outweigh the pain of doing any remotely-non-trivial task in batch. Notes "You need a batch program for autoexec.bat" is not a valid reason. Your autoexec.bat may consist of simply calling non-batch script. If you disagree with either of my 2 assumptions above, that's fine, and I may be wrong. But my question is specifically "assuming those 2 assumptions are correct, what would be the reason to still stick with batch?" If it makes it easier to suspend disbelief (in case you disagree with me), add in a 3rd assumption that the question is limited to people who already posess at least some modicum of PowerShell or Perl experience. To re-iterate - this is not meant to be a subjective question about how easy it is to learn PSh or ASPerl compared to doing advanced batch coding. That is a separate question that is too subjective to be bothered with in this post. Background: I used to do some fairly complicated batch programming back in the elder days, and remember batch as one of the worst possble programming languages I had encountered. The idea for this question came after seeing a bunch of batch questions on SO, and trying to grok the answer of one of them out of sheer curiosity and giving up in pain after a minute, exclaiming mentally "why would anyone go through this pain instead of doing that in 1 line of Perl?" :) My own plausible answer I assume there may be an an likely DOS-compatible system, which has DOS interpreter but has no compatible PowerShell or Perl... I'm not aware of one but not completely impossible.

    Read the article

  • Add/remove xml tags using a bash script.

    - by sixtyfootersdude
    I have an xml file that I want to configure using a bash script. For example if I had this xml: <a> <b> <bb> <yyy> Bla </yyy> </bb> </b> <c> <cc> Something </cc> </c> <d> bla </d> </a> (confidential info removed) I would like to write a bash script that will remove section <b> (or comment it) but keep the rest of the xml intact. I am pretty new the the whole scripting thing. I was wondering if anyone could give me a hint as to what I should look into. I was thinking that sed could be used except sed is a line editor. I think it would be easy to remove the <b> tags however I am unsure if sed would be able to remove all the text between the <b> tags. I will also need to write a script to add back the deleted section.

    Read the article

  • CentOS - Convert Each WAV File to MP3/OGG

    - by Benny
    I am trying to build a script (I'm pretty new to linux scripting) and I can't seem to figure out why I'm not able to run this script. If I keep the header (#!/bin/sh) in, I get the following: -bash: /tmp/ConvertAndUpdate.sh: /bin/sh^M: bad interpreter: No such file or directory If I take it out, I get the following: 'tmp/ConvertAndUpdate.sh: line 2: syntax error near unexpected token `do 'tmp/ConvertAndUpdate.sh: line 2: `do Any ideas? Here is the full script: #!/bin/sh for file in *.wav; do mp3=$(basename .$file. .wav).mp3; #echo $mp3 nice lame -b 16 -m m -q 9 .resample 8 .$file. .$mp3.; touch .reference .$file. .$mp3.; chown apache.apache .$mp3.; chmod 600 .$mp3.; rm -f .$file.; mv .$file. /converted; sql="UPDATE recordings SET IsReady=1 WHERE Filename='${file%.*}'" echo $sql | mysql --user=me --password=pasword Recordings #echo $sql done

    Read the article

  • Processing a log to fix a malformed IP address ?.?.?.x

    - by skymook
    I would like to replace the first character 'x' with the number '7' on every line of a log file using a shell script. Example of the log file: 216.129.119.x [01/Mar/2010:00:25:20 +0100] "GET /etc/.... 74.131.77.x [01/Mar/2010:00:25:37 +0100] "GET /etc/.... 222.168.17.x [01/Mar/2010:00:27:10 +0100] "GET /etc/.... My humble beginnings... #!/bin/bash echo Starting script... cd /Users/me/logs/ gzip -d /Users/me/logs/access.log.gz echo Files unzipped... echo I'm totally lost here to process the log file and save it back to hd... exit 0 Why is the log file IP malformed like this? My web provider (1and1) has decide not to store IP address, so they have replaced the last number with the character 'x'. They told me it was a new requirement by 'law'. I personally think that is bs, but that would take us off topic. I want to process these log files with AWstats, so I need an IP address that is not malformed. I want to replace the x with a 7, like so: 216.129.119.7 [01/Mar/2010:00:25:20 +0100] "GET /etc/.... 74.131.77.7 [01/Mar/2010:00:25:37 +0100] "GET /etc/.... 222.168.17.7 [01/Mar/2010:00:27:10 +0100] "GET /etc/.... Not perfect I know, but least I can process the files, and I can still gain a lot of useful information like country, number of visitors, etc. The log files are 200MB each, so I thought that a shell script is the way to go because I can do that rapidly on my Macbook Pro locally. Unfortunately, I know very little about shell scripting, and my javascript skills are not going to cut it this time. I appreciate your help.

    Read the article

  • I write barely functional scripts that tend to not be resuable and make the baby jesus cry. Please h

    - by maxxpower
    I received a request to add around 100 users to a linux box the users are already in ldap so I can't just use newusers and point it at a text file. Another admin is taking care of the ldap piece so all I have to do is create all the home directories and chown them to the correct user once he adds the users to the box. creating the directories isn't a problem, but I'd like a more elegant script for chowning them to the correct user. what I have currently basically looks like chown -R testuser1 testgroup1 /home/tetsuser1; chown -R testuser2 testgroup2 /home/testgroup2; chown -R testsuser3 testgroup1 /home/testuser3 bascially I took the request that the user name and group name popped it into excel added a column of "chown -R" to the front, then added a column of "/", copied and pasted the username column after it and then added a column of ";" and dragged it down to the second to last row. Popped it into notepad ran some quick find and replaces and in less than a minute I have a completed request and a sad empty feeling. I know this was a really ghetto method and I'm trying to get away from using excel to avoid learning new scripting techniques so here's my real question. tl;dr I made 100 home directories and chowned them to the correct users, but it was ugly. Actual question below. You have a file named idlist that looks like this (only with say 1000 users and real usernames and groups) testuser1 testgroup1 testuser2 testgroup2 testuser3 testgroup1 write a script that creates home directories for all the users and chowns the created directories to the correct user and group. To make the directories I used the following(feel free to flame/correct me on this as well. ) var= 'cut -f1 -d" " idlist' (I used backticks not apostrophes around the cut command) mkdir $var

    Read the article

  • restrict script inside iframe to run only within pages of same top-level domain?

    - by Justin Grant
    I'd like to enforce a requirement that client script inside a page (which in turn is loaded inside an iframe of another page) will only run when the parent page is on the same top-level domain as the framed page (although it may be on another hostname in that domain). Is this do-able? I assume that the easy solution of looking at top.location.host won't be available due to cross-site scripting limitations, but I'm wondering if other javascript hackery could suffice. Constraints on any potential solution inculde: I need to be able to run XmlHttpRequest calls inside the child page, and I need to validate that the hostname is in the same domain before I make those calls. (this makes a document.domain solution challenging because AFAIK setting document.domain disables the ability to make XmlHttpRequest calls. I can control client-side script and HTML on both parent or child (and I can create new pages if needed), but I can't make any server-side code changes. I can't simulate the above via server-side calls or proxies, because the child page's hostname uses a forms auth system with hostname-scoped cookies that I can't get access to from the parent page since it's on a different hostname. I don't have enough control over the child-frame site to be able to put both sites behind the same reverse-proxy or load-balancer (which would enable me to put both sites on the same hostname). I don't actually need to access any UI inside the IFrame-- the iframe is invisible and I'm only using it to run javascript within the security context of a site on a different hostname from the parent page. So at this point I'm stumped. Got any ideas? I want to make sure I'm not overlooking an easy solution before giving up.

    Read the article

  • I trying to backreference using the sed command

    - by Paul
    I am relative new to shell scripting and sed. I need to substitute a pattern, globably, but I also need to remember (or save) part of the pattern and use it later in the same substitute command. The saved pattern will be varible, so I need to use a wild card. For example, input message=trt:GetAudioSourcesRequest/> and I want to end up with something like input message=trt:GetAudioSourcesRequest PAUL/GetAudioSourcesRequest/> but the function string "GetAudioSourcesRequest" will change (in length also) throughtout the file, so I need a wild card, e.g. sed -i "s/input message=trt:<wild card in here>/>/input message=trt:<print wild card> PAUL/<print wild card>/> I have managed to get the following command to nearly do what I want but it is too rigid. It only stores a 4 syllable pattern so if I have a function name such as GetProfileRequest, this doesn't work echo "input message=\"trt:GetAudioSourcesRequest\"/>" | sed 's/input message=\"trt:\([A-Z][a-z]*\)\([A-Z][a-z]*\)\([A-Z][a-z]*\)\([A-Z][a-z]*\).*/input message=\"trt:\1\2\3\4\ PAUL\/\1\2\3\4"\/\>/g' This outputs input message="trt:GetAudioSourcesRequest PAUL/GetAudioSourcesRequest"/> Which is ok but when I use GetProfileRequest this doesn't. I have come accross \W and [^[:alnum:]] or [[:alnum:]] but I don't how to use them Thanks in advance.

    Read the article

  • Game engine deployment strategy for the Android?

    - by Jeremy Bell
    In college, my senior project was to create a simple 2D game engine complete with a scripting language which compiled to bytecode, which was interpreted. For fun, I'd like to port the engine to android. I'm new to android development, so I'm not sure which way to go as far as deploying the engine on the phone. The easiest way I suppose would be to require the engine/interpreter to be bundled with every game that uses it. This solves any versioning issues. There are two problems with this. One: this makes each game app larger and two: I originally released the engine under the LGPL license (unfortunately), but this deployment strategy makes it difficult to conform to the rules of that license, particularly with respect to allowing users to replace the lib easily with another version. So, my other option is to somehow have the engine stand alone as an Activity or service that somehow responds to intents raised by game apps, and somehow give the engine app permissions to read the scripts and other assets to "run" the game. The user could then be able to replace the engine app with a different version (possibly one they made themselves). Is this even possible? What would you recommend? How could I handle it in a secure way?

    Read the article

  • Best way to convert log files (*.txt) to web-friendly files (*.html, *.jsp, etc)?

    - by prometheus
    I have a bunch of log files which are pure text. Here is an example of one... Overall Failures Log SW Failures - 03.09.2010 - /logs/swfailures.txt - 23 errors - 24 warnings HW Failures - 03.09.2010 - /logs/hwfailures.txt - 42 errors - 25 warnings SW Failures - 03.10.2010 - /logs/swfailures.txt - 32 errors - 27 warnings HW Failures - 03.10.2010 - /logs/hwfailures.txt - 11 errors - 31 warnings These files can get quite large and contain a lot of other information. I'd like to produce an HTML file from this log that will add links to key portions and allow the user to open up other log files as a result... SW Failures - 03.09.2010 - <a href="/logs/swfailures.txt">/logs/swfailures.txt</a> - 23 errors - 24 warnings This is greatly simplified as I would like to add many more links and other html elements. My question is -- what is the best way to do this? If the files are large, should I generate the html before serving it to the user or will jsp do? Should I use perl or other scripting languages to do this? What are your thoughts and experiences?

    Read the article

  • Correlating traditional Windows joystick axes with HID

    - by Wade Williams
    I'm a bit confused on the description of joystick axes and I'm hoping that someone has a link or document which could help clear my confusion. I'm not a Windows guy, so trying to port some traditional Windows gameport code has me a bit confused. We all know about the common first three axes: X Y Z My understanding was that in the gameport-style interface the three other axes are: R U V However, looking in my IOHIDUsageTables (OS X), I see: kHIDUsage_GD_X = 0x30, /* Dynamic Value */ kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ This has me a bit confused due to the three R axis (though that does not appear to be uncommon) and the lack of a U axis. Two questions: 1) Can anyone confirm to what axis the traditional U axis would be? I saw one document describe it as "the axis for rudder pedals" leading me to believe it would be Rz. 2) Can anyone describe in more detail the typical usages of the V and Vbr axes? I understand the descriptions are "vector" and "relative vector,' respectively, but I'm having difficult visualizing what that means in terms of a physical device. All enlightenment and documentation pointers welcome.

    Read the article

  • Apache Cordova (Phonegap): is jsop needed for cross-site scripting?

    - by DEX
    I've just started using Apache Cordova. I have an library that makes calls (via ajax) to a soap server. When I run these on my local machine in chrome, I get cross site scripting errors when trying to make calls to the service. When I run the same exact code using the Cordova browser in the iOS emulator, the scripts seem to hit the server fine and the response data is received properly. So my question is how is the Cordova browser able to make these requests without cross-site scripting permissions & JSONP ? One thing I noticed is that when the request is sent from iOS, there is no "Origin" header. Is this allowing the Cordova browser to stealthily circumvent cross-site scripting requirements? Is it possible that the node.js server on the device (I believe this is how Cordova works) is manipulating the headers to allow this? I'd like to avoid enabling cross-site scripting on my site so I think this "feature" is nice, but I'm wondering if it's a security hole as well. Anyone have experience with this?

    Read the article

  • ASP.NET MVC 3 embrace dynamic type - CSDN.NET - CSDN Software Development Channel

    - by user559071
    About a decade ago, Microsoft will all bet on the WebForms and static types. With the complete package from scattered to the continuous development, and now almost every page can be viewed as its own procedure. Subsequent years, the industry continued to move in another direction, love is better than separation package, better than the late binding early binding to the idea. This leads to two very interesting questions. The first is the problem of terminology. Consider the original Smalltalk MVC model, view and controller is not only tightly coupled together, and usually in pairs. Most of the framework is that Microsoft, including the classic VB, WinForms, WebForms, WPF and Silverlight, they both use the code behind file to store the controller logic. But said "MVC" usually refers to the view and controller are loosely coupled framework. This is especially true for the Web framework, HTML form submission mechanism allows any views submitted to any of the controller. Since this article was mainly talking about Web technologies, so we need to use the modern definition. The second question is "If you're Microsoft, how to change orbit without causing too much pressure to the developer?" So far, the answer is: new releases each year, until the developers meet up. ASP.NET MVC's first product was released last March. Released in March this year, ASP.NET MVC 2.0. 3.0 RC 2 is currently in phase, expected to be released next March. December 10, Microsoft released ASP.NET MVC 3.0 Release Candidate 2. RC 2 is built on top of Microsoft's commitment to the jQuery: The default project template into jQuery 1.4.4, jQuery Validation 1.7 and jQuery UI. Although people think that Microsoft will focus shifted away from server-side controls to be a joke, but the introduction of Microsoft's jQuery UI is that this is the real thing. For those worried about the scalability of the developers, there are many excellent control can replace the session state. With SessionState property, you can tell the controller session state is read-only, read-write, or can be completely ignored in the. This site is no single server, but if a server needs to access another server session state, then this approach can provide a great help. MVC 3 contains Razor view engine. By default, the engine will be encoded HTML output, so that we can easily output on the screen the text of the original. HTML injection attacks even without the risk of encoded text can not easily prevent the page rendering. For many C # developers in the end do what is most shocking that MVC 3 for the controller and view and embrace the dynamic type. ViewBag property will open a dynamic object, developers can run on top of the object to add attributes. In general, it is used to send the view from the controller non-mode data. Scott Guthrie provides state of the sample contains text (such as the current time) and used to assemble the list box entries. Asked Link: http://www.infoq.com/cn/news/2010/12/ASPNET-MVC-3-RC-2; jsessionid = 3561C3B7957F1FB97848950809AD9483

    Read the article

  • Binding on a port with netpipes/netcat

    - by mindas
    I am trying to write a simple bash script that is listening on a port and responding with a trivial HTTP response. My specific issue is that I am not sure if the port is available and in case of bind failure I fall back to next port until bind succeeds. So far to me the easiest way to achieve this was something like: for (( i=$PORT_BASE; i < $(($PORT_BASE+$PORT_RANGE)); i++ )) do if [ $DEBUG -eq 1 ] ; then echo trying to bind on $i fi /usr/bin/faucet $i --out --daemon echo test 2>/dev/null if [ $? -eq 0 ] ; then #success? port=$i if [ $DEBUG -eq 1 ] ; then echo "bound on port $port" fi break fi done Here I am using faucet from netpipes Ubuntu package. The problem with this is that if I simply print "test" to the output, curl complains about non-standard HTTP response (error code 18). That's fair enough as I don't print HTTP-compatible response. If I replace echo test with echo -ne "HTTP/1.0 200 OK\r\n\r\ntest", curl still complains: user@server:$ faucet 10020 --out --daemon echo -ne "HTTP/1.0 200 OK\r\n\r\ntest" ... user@client:$ curl ip.of.the.server:10020 curl: (56) Failure when receiving data from the peer I think the problem lies in how faucet is printing the response and handling the connection. For example if I do the server side in netcat, curl works fine: user@server:$ echo -ne "HTTP/1.0 200 OK\r\n\r\ntest\r\n" | nc -l 10020 ... user@client:$ curl ip.of.the.server:10020 test user@client:$ I would be more than happy to replace faucet with netcat in my main script, but the problem is that I want to spawn independent server process to be able to run client from the same base shell. faucet has a very handy --daemon parameter as it forks to background and I can use $? (exit status code) to check if bind succeeded. If I was to use netcat for a similar purpose, I would have to fork it using & and $? would not work. Does anybody know why faucet isn't responding correctly in this particular case and/or can suggest a solution to this problem. I am not married neither to faucet nor netcat but would like the solution to be implemented using bash or it's utilities (as opposed to write something in yet another scripting language, such as Perl or Python).

    Read the article

  • Fancy dynamic list in Android: TableLayout vs ListView

    - by Ralkie
    There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like: Text11 Text12 Button1 Button2 Text21 Text22 Button1 Button2 ... At first obvious way to accomplish that seemed to be TableLayout. I was expecting to have layout/styling data specified in res/layout/*.xml and to populate it with some dataset from java code (as with ListView, for which its possible to specify TextView of item in *.xml and bind it to some array using ArrayAdapter). But after playing for a while, all I found to be possible is fully populating TableLayout programatically. Still, creating TableRow by TableRow and setting layout attributes directly in java code doesn't seem elegant enough. So the questions are: Am I at the right path? Is TableLayout really best View to accomplish that? Maybe it's more appropriate to extend ListView or something else to meet such requirements? Is it possible to have TableLayout/TableRow template specified in *.xml and data bound to this template in java side?

    Read the article

  • Java - How to change context root of a dynamic web project in eclipse

    - by Yatendra Goel
    I have developed a dynamic web project in eclipse. Now I can access it through my browser using the following url: http://localhost:8080/MyDynamicWebApp Now I want to change the access url to http://localhost:8080/app I changed the context root from the project properties | Web Project Settings | Context Root But it is not working. The web app still has the access url as earlier. I have re-deployed the application on tomcat, re-started the tomcat and have done everything that should be done but the access url is the same as earlier. I found that there were no server.xml file attached with the WARfile. The how the tomcat is determining that the context root of my web app is /MyDynamicWebApp and is allowing me to access the application through that url

    Read the article

  • Fields_for dynamic label

    - by sebajb
    I have dynamic form which has a set of values. I created a partial which contains text fields which I display. Next to each of them I would like to display a label containing the title of the text. For instance First Name, and Last Name would not be known previously. How do I go about doing that? It seems that I cannot access the attributes directly. But when I use the label field, the variable name in the label is displayed not the actual value.

    Read the article

  • Dynamic Tree control in Flex 3

    - by nimmyliji
    I am looking for sample code to create a dynamic Tree control in Flex using a Collection of objects obtained from the backend(Perl cgi). So, initially the Tree will display the root nodes. Clicking root node, will invoke the data for populating the child nodes (basically adding child nodes on demand). Clicking child nodes will pull another collection add child nodes of child node. So, lets assume Initially the Tree will display - Root1 Root2 Root3 Clicking Root1 will display something like this - Root1 Child 1 Child 2 Root2 Root3 And Clicking Child1 will display - Root1 Child 1 Child1 of Child 1 Child2 of Child 1 Child 2 Root2 Root3 Is it possible? Thanks in advance...

    Read the article

  • Can a DevExpress XtraGrid be filled using a a Dynamic SELECT statement string

    - by Gerhard Weiss
    Can a DevExpress XtraGrid be filled using a a Dynamic SELECT statement string? i.e. SELECT * FROM Employee or SELECT * FROM Dependents To fill our XtraGrids currently, we use a ORM that creates entities. To do this it takes a lot of steps and time. What is driving me to ask this question is we do a lot of client aquistions where we get hundreds of files. I do not want to create entities for all of these then have to create an XtraGrid for each entity. Ideally if I can just feed it a SELECT statement and the XtraGrid could render it then I could use the XtraGrid very nice data minipulation features (Filter, Group By, etc). If you have any other ideas or suggestions please to not hesitate to post them.

    Read the article

  • FF extension: a popup with dynamic menuitems, with each menu item having another popup

    - by encryptor
    I am building an extension that has a popup whose elements are constructed by a function call everytime the mouse hovers over the popup option. I am able to achieve this. Now I need to have a popup for each of the menu item (inside the original popup) which is not dynamic though. I have this code, but it does not work: var myMenuPopup = document.getElementById("file-popup4"); for (var m=0; m var newItem = document.createElement("menupopup"); newItem.setAttribute("label", publicdisplayname[m]); newItem.setAttribute("id", "public" + m); var new1 = document.createElement("menuitem"); new1.setAttribute("label","Home"); new1.setAttribute("id", "publichome" + m); newItem.onclick = function(){ } newItem.appendChild(new1); myMenuPopup.appendChild(newItem); but this doesnt work. Can someone please help me out with whats the problem

    Read the article

  • Dynamic find methods Vs conditional statements

    - by piemesons
    Student.find(:all, :conditions => [‘name = ? and status = ?’ ‘mohit’, 1]) Vs Student.find_all_by_name_and_status(‘mohit’, 1) Both the queries will result the same set of row but first one is preferable cause in the second way there will be exception generated method_missing and then rails will try to relate it as dynamic method. if fine then result set to returned. Can any body explain me this in a good manner. What exactly is happening behind the screen. Please correct me if i am wrong.

    Read the article

  • Constructing dynamic columns from parameters in Sybase

    - by Chapax
    Hi, I'm trying to write a stored proc (SP) in Sybase. The SP takes 5 varchar parameters. Based on the parameters passed, I want to construct the column names to be selected from a particular table. The below works: DECLARE @TEST VARCHAR(50) SELECT @TEST = "country" --print @TEST execute("SELECT DISTINCT id_country AS id_level, Country AS nm_level FROM tempdb..tbl_books INNER JOIN (tbl_ch2_bespoke_report INNER JOIN tbl_ch2_bespoke_rpt_mapping ON tbl_ch2_bespoke_report.id_report = tbl_ch2_bespoke_rpt_mapping.id_report) ON id_" + @TEST + "= tbl_ch2_bespoke_rpt_mapping.id_pnl_level WHERE tbl_ch2_bespoke_report.id_report = 14") but gives me multiple results: 1 1 row(s) affected. id_level nm_level 1 4376 XYZ 2 4340 ABC I would like to however only obtain the 2nd result. Do I need to necessarily use dynamic SQL to achieve this? Many thanks for your help. --Chapax

    Read the article

  • Scrambling URLS for dynamic data

    - by ggonsalv
    What is the best method to obfuscate the urls created in Dynamic Data? eg \Products\List.aspx?ProductId=2 could become \Products\List.aspx?x=UHJvZHVjdElkPTI= where "ProductId=2" is base 64 encoded to prevent casual snooping on \Products\List.aspx?ProductId=3 \Products\List.aspx?ProductId=4 etc...? I will probably have to inherit from an existing object and override some function The question is which object and what function GetActionPath of the Metamodel object seems interesting, but how does the DynamicRoute "{table}/{Action}.aspx" play in into it... Right now on Asp.net 1.1 site I use an custom implementation of the following code. http://www.mvps.org/emorcillo/en/code/aspnet/qse.shtml It is HTTPModule that uses regular expression to rewrite all the querystrings and also with reflection changes the Querystring collection with decoded values. So where is the hook to affect the change.

    Read the article

  • Determining if a .NET type is dynamic (created using Reflection.Emit)

    - by Diego Mijelshon
    While the .NET 4 framework provides the Assembly.IsDynamic method, that's not the case with .NET 2.0/3.5. The use case is simple: for logging purposes, I want to determine the underlying type name of an entity that might be wrapped by a dynamic proxy without having any references to NHibernate or Castle (which know about the proxy) For example, I might have a CatProxYadaYada, but I'm interested in Cat. What's the easiest way to get that type? I was thinking of this skeleton: var type = obj.GetType(); while (IsProxy_Dynamic_Whatever(obj)) type = type.BaseType; return type;

    Read the article

  • MVC Form and Dictionary Type

    - by Brian Schmitt
    I am attempting to use a property on my model that is of type Dictionary<string, string>. This dictionary is one of several other properties on the model, and I am using the dictionary as a key/value store to produce a 'dynamic' form. E.G.: User Name Settings A B I want to be able to submit and save any changes to settings A and B. I can submit the form and get my posted values in all my other fields, however the dictionary gets set to null. <%=Html.LabelFor(m => m.Name)%> <%=Html.DisplayFor(m => m.Name)%> <%=Html.LabelFor(m => m.Settings["A"])%> <%=Html.TextBoxFor(m => m.Settings["A"])%> <%=Html.LabelFor(m => m.Settings["B"])%> <%=Html.TextBoxFor(m => m.Settings["B"])%> Is there a better way to produce the dynamic form with a key/value pair? The actual code will be using partials (there several hundred variations), and the above is only a contrived example.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >