Search Results

Search found 575 results on 23 pages for 'aaa'.

Page 21/23 | < Previous Page | 17 18 19 20 21 22 23  | Next Page >

  • Java to JavaScript (Encryption related)

    - by balexandre
    Hi guys, I'm having difficulties to get the same string in Javascript and I'm thinking that I'm doing something wrong... Java code: import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Date; import java.util.GregorianCalendar; import sun.misc.BASE64Encoder; private static String getBase64Code(String input) throws UnsupportedEncodingException, NoSuchAlgorithmException { String base64 = ""; byte[] txt = input.getBytes("UTF8"); byte[] text = new byte[txt.length+3]; text[0] = (byte)239; text[1] = (byte)187; text[2] = (byte)191; for(int i=0; i<txt.length; i++) text[i+3] = txt[i]; MessageDigest md = MessageDigest.getInstance("MD5"); md.update(text); byte digest[] = md.digest(); BASE64Encoder encoder = new BASE64Encoder(); base64 = encoder.encode(digest); return base64; } I'm trying this using Paj's MD5 script as well Farhadi Base 64 Encode script but my tests fail completely :( my code: function CalculateCredentialsSecret(type, user, pwd) { var days = days_between(new Date(), new Date(2000, 1, 1)); var str = type.toUpperCase() + user.toUpperCase() + pwd.toUpperCase() + days; var md5 = hex_md5(str); var b64 = base64Encode(md5); return encodeURIComponent(b64); } Does anyone know how can I convert this Java method into a Javascript one? Thank you Tests (for today, 3740 days after January 1st, 2000 var secret = CalculateCredentialsSecret('AAA', 'BBB', 'CCC'); // secret SHOULD be: S3GYAfGWlmrhuoNsIJF94w==

    Read the article

  • using XSL to replace XML nodes with new nodes

    - by iHeartGreek
    I need an XSL solution to replace XML nodes with new nodes. Say I have the following existing XML structure: <root> <criteria> <criterion>AAA</criterion> </criteria> </root> And I want to replace the one criterion node with: <criterion>BBB</criterion> <criterion>CCC</criterion> <criterion>DDD</criterion> So that the final XML result is: <root> <criteria> <criterion>BBB</criterion> <criterion>CCC</criterion> <criterion>DDD</criterion> </criteria> </root> I have tried using substring-before and substring-after to just copy the first half of the structure, then just copy the second half (in order to fill in my new nodes in between the two halves) but it appears that the substring functions only recognize text in between the nodes' tags, and not the tags themselves like I want them to. :( :( Any other solutions?

    Read the article

  • Rhino Commons and Rhino Mocks Reference Documents?

    - by Ogre Psalm33
    Ok, is it just me, or does there seem to be a lack of (easy to find) reference documentation for Rhino Commons and Rhino Mocks? My coworkers have started using Rhino Mocks and Rhino Commons (particularly the NHibernate stuff), and I found a few tutorial-ish examples, which were good. But when I see them making use of a class in their code--let's pick something like Rhino.Commons.NHRepository, for example--I have been having a hard time just finding someplace on the web that tells me what Rhino.Commons.NHRepository is or what it does. I like to learn by looking at real examples, but using this approach, it's very handy to look at what the full docs are for a class, instead of just the current context. Similarly, I saw IaMockedRepository.Expect(...) being used in some code, but it took me forever to finally find this page that explains the AAA syntax for Rhino Mocks, which made it clear to me. I've found the Ayende.com wiki on Rhino Commons, but that seems to have a number of broken links. To me, the Rhino libraries seem like a great set of libraries in need of some desperate community help in the documentation area (Of course, as we all know, documentation is not the forte of most coders, and incomplete docs are all too common). Does anyone know if this is something in the works, someplace that some volunteer documenters are needed, or is there some great reference docs out there that I have somehow missed to Rhino Mocks and Rhino Commons?

    Read the article

  • Generate a set of strings with maximum edit distance

    - by Kevin Jacobs
    Problem 1: I'd like to generate a set of n strings of fixed length m from alphabet s such that the minimum Levenshtein distance (edit distance) between any two strings is greater than some constant c. Obviously, I can use randomization methods (e.g., a genetic algorithm), but was hoping that this may be a well-studied problem in computer science or mathematics with some informative literature and an efficient algorithm or three. Problem 2: Same as above except that adjacent characters cannot repeat; the i'th character in each string may not be equal to the i+1'th character. E.g., 'CAT', 'AGA' and 'TAG' are allowed, 'GAA', 'AAT', and 'AAA' are not. Background: The basis for this problem is bioinformatic and involves designing unique DNA tags that can be attached to biologically derived DNA fragments and then sequenced using a fancy second generation sequencer. The goal is to be able to recognize each tag, allowing for random insertion, deletion, and substitution errors. The specific DNA sequencing technology has a relatively low error rate per base (~1%), but is less precise when a single base is repeated 2 or more times (motivating the additional constraints imposed in problem 2).

    Read the article

  • How to get XML element/attribute name in SQL Server 2005

    - by OG Dude
    Hi, I have a simple procedure in SQL Server 2005 which takes some XML as input. The element attributes correspond to field names in tables. I'd like to be able to determine <elementName>, <attribNameX> dynamically as to avoid having to hardcode them into the procedure. How can I do this? The XML looks like this: <ROOT> <elementName attribName1 = "xxx" attribName2 = "yyy"/> <elementName attribName1 = "aaa" attribName2 = "bbb"/> ... </ROOT> The stored procedure like this: CREATE PROC dbo.myProc ( @XMLInput varchar(1000) ) AS BEGIN SET NOCOUNT ON DECLARE @XMLDocHandle int EXEC sp_xml_preparedocument @XMLDocHandle OUTPUT, @XMLInput SELECT someTable.someCol FROM dbo.someTable JOIN OPENXML (@XMLDocHandle, '/ROOT/elementName',1) WITH (attrib1Name int, attrib2Name int) AS XMLData ON someTable.attribName1 = XMLData.attribName1 AND someTable.attribName2 = XMLData.attribName2 EXEC sp_xml_removedocument @XMLDocHandle END GO The question has been asked here before but maybe there is a cleaner solution. Additionally, I'd like to pass the tablename as a parameter as well - I read some stuff arguing that this is bad style - so what would be a good solution for having a dynamic tablename? Thanks a lot in advance, /David

    Read the article

  • Silverlight datagrid fails to display data.

    - by Jekke
    I have a datagrid defined in my project's XAML: <data:DataGrid IsReadOnly="True" Grid.Row="1" Grid.Column="1" x:Name="gridOfferings" Margin="10,10,10,10" AutoGenerateColumns="False"> <data:DataGrid.Columns> <data:DataGridTextColumn Binding="{Binding Trader}" DisplayIndex="0" Header="Trader" Width="Auto" FontSize="11"/> <data:DataGridTextColumn Binding="{Binding Product}" DisplayIndex="1" Header="Product" Width="Auto" FontSize="11"/> </data:DataGrid.Columns> </data:DataGrid> I bind it to a List< of custom objects: public MainPage() { InitializeComponent(); _Rows = new List<OfferingRowData>(); _Rows.Add(new OfferingRowData() { Trader = "Kameilya Loenstein", Product = "American Consolidated AAA", Price = 24.95, OfferingMade = DateTime.Now }); _Rows.Add(new OfferingRowData() { Trader = "Bill Foobar", Product = "IBM Mid-Atlantic Exotic", Price = 204.90, OfferingMade = DateTime.Now.AddMinutes(-3) }); gridOfferings.ItemsSource = _Rows; } When it shows up on the page, the column headers appear, but none of the data does. What am I doing wrong?

    Read the article

  • What is the return type for a anonymous linq query select? What is the best way to send this data ba

    - by punkouter
    This is a basic question. I have the basic SL4/RIA project set up and I want to create a new method in the domain service and return some data from it. I am unsure the proper easiest way to do this.. Should I wrap it up in a ToList()? I am unclear how to handle this anonymous type that was create.. what is the easiest way to return this data? public IQueryable<ApplicationLog> GetApplicationLogsGrouped() { var x = from c in ObjectContext.ApplicationLogs let dt = c.LogDate group c by new { y = dt.Value.Year, m = dt.Value.Month, d = dt.Value.Day } into mygroup select new { aaa = mygroup.Key, ProductCount = mygroup.Count() }; return x; // return this.ObjectContext.ApplicationLogs.Where(r => r.ApplicationID < 50); } Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#1>' to 'System.Linq.IQueryable<CapRep4.Web.ApplicationLog>'. An explicit conversion exists (are you missing a cast?) 58 20 CapRep4.Web

    Read the article

  • How to bind an ADF Table on button click

    - by Juan Manuel Formoso
    Coming from ASP.NET I'm having a hard time with basic ADF concepts. I need to bind a table on a button click, and for some reason I don't understand (I'm leaning towards page life cycle, which I guess is different from ASP.NET) it's not working. This is my ADF code: <af:commandButton text="#{viewcontrollerBundle.CMD_SEARCH}" id="cmdSearch" action="#{backingBeanScope.indexBean.cmdSearch_click}" partialSubmit="true"/> <af:table var="row" rowBandingInterval="0" id="t1" value="#{backingBeanScope.indexBean.transactionList}" partialTriggers="::cmdSearch" binding="#{backingBeanScope.indexBean.table}"> <af:column sortable="false" headerText="idTransaction" id="c2"> <af:outputText value="#{row.idTransaction}" id="ot4"/> </af:column> <af:column sortable="false" headerText="referenceCode" id="c5"> <af:outputText value="#{row.referenceCode}" id="ot7"/> </af:column> </af:table> This is cmdSearch_click: public String cmdSearch_click() { List l = new ArrayList(); Transaction t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(1)); t.setReferenceCode("AAA"); l.add(t); t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(2)); t.setReferenceCode("BBB"); l.add(t); setTransactionList(l); // AdfFacesContext.getCurrentInstance().addPartialTarget(table); return null; } The commented line also doesn't work. If I populate the list on my Bean's constructor, the table renders ok. Any ideas?

    Read the article

  • Verify an event was raised by mocked object

    - by joblot
    In my unit test how can I verify that an event is raised by the mocked object. I have a View(UI) -- ViewModel -- DataProvider -- ServiceProxy. ServiceProxy makes async call to serivce operation. When async operation is complete a method on DataProvider is called (callback method is passed as a method parameter). The callback method then raise and event which ViewModel is listening to. For ViewModel test I mock DataProvider and verify that handler exists for event raised by DataProvider. When testing DataProvider I mock ServiceProxy, but how can I test that callback method is called and event is raised. I am using RhinoMock 3.5 and AAA syntax Thanks -- DataProvider -- public partial class DataProvider { public event EventHandler<EntityEventArgs<ProductDefinition>> GetProductDefinitionCompleted; public void GetProductDefinition() { var service = IoC.Resolve<IServiceProxy>(); service.GetProductDefinitionAsync(GetProductDefinitionAsyncCallback); } private void GetProductDefinitionAsyncCallback(ProductDefinition productDefinition, ServiceError error) { OnGetProductDefinitionCompleted(this, new EntityEventArgs<ProductDefinition>(productDefinition, error)); } protected void OnGetProductDefinitionCompleted(object sender, EntityEventArgs<ProductDefinition> e) { if (GetProductDefinitionCompleted != null) GetProductDefinitionCompleted(sender, e); } } -- ServiceProxy -- public class ServiceProxy : ClientBase<IService>, IServiceProxy { public void GetProductDefinitionAsync(Action<ProductDefinition, ServiceError> callback) { Channel.BeginGetProductDefinition(EndGetProductDefinition, callback); } private void EndGetProductDefinition(IAsyncResult result) { Action<ProductDefinition, ServiceError> callback = result.AsyncState as Action<ProductDefinition, ServiceError>; ServiceError error; ProductDefinition results = Channel.EndGetProductDefinition(out error, result); if (callback != null) callback(results, error); } }

    Read the article

  • usort - more parameters

    - by pgfonline
    Hallo, how can I pass more parameters to usort? I have different functions, which are very similar in structure, I want to have just one function: <?php $arr = array( array('number' => 100, 'string'=>'aaa'), array('number'=>50, 'string'=>'bdef'), array('number'=>150, 'string'=>'cbba') ); usort($arr, 'sortNumberDesc'); //How can I use just a single function? //How can I pass further parameters to usort? function sortNumberDesc($a, $b){ $a = $a['number']; $b = $b['number']; if ($a == $b) return 0; return ($a > $b) ? -1 : +1; } function sortNumberAsc($a, $b){ $a = $a['number']; $b = $b['number']; if ($a == $b) return 0; return ($a < $b) ? -1 : +1; } //I want to do the same with just one function: //Sort ID is the search index, reverse DESC or ASC function sort($a, $b, $sortId='number', $reverse = 0){ $a = $a[$sortId]; $b = $b[$sortId]; if ($a == $b) return 0; if($reverse == false) return ($a > $b) ? -1 : +1; else return ($a < $b) ? -1 : +1; } print_r($arr); ?>

    Read the article

  • How to keep your unit test Arrange step simple and still guarantee DDD invariants ?

    - by ian31
    DDD recommends that the domain objects should be in a valid state at any time. Aggregate roots are responsible for guaranteeing the invariants and Factories for assembling objects with all the required parts so that they are initialized in a valid state. However this seems to complicate the task of creating simple, isolated unit tests a lot. Let's assume we have a BookRepository that contains Books. A Book has : an Author a Category a list of Bookstores you can find the book in These are required attributes : a book has to have an author, a category and at least a book store you can buy the book from. There's likely to be a BookFactory since it is quite a complex object, and the Factory will initialize the Book with at least all the mentioned attributes. Now we want to unit test a method of the BookRepository that returns all the Books. To test if the method returns the books, we have to set up a test context (the Arrange step in AAA terms) where some Books are already in the Repository. If the only tool at our disposal to create Book objects is the Factory, the unit test now also uses and is dependent on the Factory and inderectly on Category, Author and Store since we need those objects to build up a Book and then place it in the test context. Would you consider this is a dependency in the same way that in a Service unit test we would be dependent on, say, a Repository that the Service would call ? How would you solve the problem of having to re-create a whole cluster of objects in order to be able to test a simple thing ? How would you break that dependency and get rid of all these attributes we don't need in our test ? By using mocks or stubs ? If you mock up things a Repository contains, what kind of mock/stubs would you use as opposed to when you mock up something the object under test talks to or consumes ?

    Read the article

  • How to keep your unit tests simple and isolated and still guarantee DDD invariants ?

    - by ian31
    DDD recommends that the domain objects should be in a valid state at any time. Aggregate roots are responsible for guaranteeing the invariants and Factories for assembling objects with all the required parts so that they are initialized in a valid state. However this seems to complicate the task of creating simple, isolated unit tests a lot. Let's assume we have a BookRepository that contains Books. A Book has : an Author a Category a list of Bookstores you can find the book in These are required attributes : a book has to have an author, a category and at least a book store you can buy the book from. There's likely to be a BookFactory since it is quite a complex object, and the Factory will initialize the Book with at least all the mentioned attributes. Now we want to unit test a method of the BookRepository that returns all the Books. To test if the method returns the books, we have to set up a test context (the Arrange step in AAA terms) where some Books are already in the Repository. If the only tool at our disposal to create Book objects is the Factory, the unit test now also uses and is dependent on the Factory and inderectly on Category, Author and Store since we need those objects to build up a Book and then place it in the test context. Would you consider this is a dependency in the same way that in a Service unit test we would be dependent on, say, a Repository that the Service would call ? How would you solve the problem of having to re-create a whole cluster of objects in order to be able to test a simple thing ? How would you break that dependency and get rid of all these attributes we don't need in our test ? By using mocks or stubs ? If you mock up things a Repository contains, what kind of mock/stubs would you use as opposed to when you mock up something the object under test talks to or consumes ?

    Read the article

  • Why my async call does not work?

    - by Petr
    Hi, I am trying to understand what is IAsyncresult good and therefore I wrote this code. The problem is it behaves as I called "MetodaAsync" normal way. While debugging, the program stops here until the method completed. Any help appreciated, thank you. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace ConsoleApplication1 { class Program { delegate int Delegat(); static void Main(string[] args) { Program p=new Program(); Delegat d = new Delegat(p.MetodaAsync); IAsyncResult a = d.BeginInvoke(null, null); //I have removed callback int returned=d.EndInvoke(a); Console.WriteLine("AAA"); } private int MetodaAsync() { int AC=0; for (int I = 0; I < 600000; I++) { for (int A = 0; A < 6000000; A++) { } Console.Write("B"); } return AC; } } }

    Read the article

  • SQLite transaction doesn't work as expected

    - by troll
    I prepared 2 files, "1.php" and "2.php". "1.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "aaa<br>"; sleep(55); $dbh->commit(); print "bbb"; ?> and "2.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "ccc<br>"; $dbh->commit(); print "ddd"; ?> and I excute "1.php". It starts a transaction and waits 55 seconds. So when I immediately excute "2.php", my expectation is this: "1.php" is getting transaction and "1" holds a database lock "2" can not begin a transaction "2" can not get database lock so "2" have to wait 55 seconds BUT, but the test went another way. When I excute "2",then "2" immediately returned it's result "2" did not wait so I have to think that "1" could not get transaction, or could not get database lock. Can anyone help?

    Read the article

  • error message The URI does not identify an external Java class

    - by iHeartGreek
    Hi! I am new to XSL, and thus new to using scripts within the XSL. I have taken example code (also using C#) and adapted it for my own use.. but it does not work. The error message is: The URI urn:cs-scripts does not identify an external Java class The relevant code I have is: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:strTok="urn:cs-scripts"> ... ... ... </xsl:template> <xsl:variable name="temp"> <xsl:value-of select="tok:getList('AAA BBB CCC', ' ')"/> </xsl:variable> <msxsl:script language="C#" implements-prefix="tok"> <![CDATA[ public string[] getList(string str, char[] delim) { return str.Split(delim, StringSplitOptions.None); } public string getString(string[] list, int i) { return list[i]; } ]]> </msxsl:script> </xsl:stylesheet>

    Read the article

  • Seeking C Union clarity

    - by mustISignUp
    typedef union { float flts[4]; struct { GLfloat r; GLfloat theta; GLfloat phi; GLfloat w; }; struct { GLfloat x; GLfloat y; GLfloat z; GLfloat w; }; } FltVector; Ok, so i think i get how to use this, (or, this is how i have seen it used) ie. FltVector fltVec1 = {{1.0f, 1.0f, 1.0f, 1.0f}}; float aaa = fltVec1.x; etc. But i'm not really groking how much storage has been declared by the union (4 floats? 8 floats? 12 floats?), how? and why? Also why two sets of curly braces when using FltVector {{}}? Any pointers much appreciated (sorry for the pun)

    Read the article

  • Jquery find first visible element after horizontal scroll

    - by lolo flores
    I’m new (only two weeks old) in Jquery, so please bear with me. I know that a very similar question was asked some time ago but I do not know how to adapt the answer to my problem. I have a very wide multicolumn layout something like this: | aaaa | bbbb | cccc | … | | aaaa | b | cc | … | | aaa | cccc | ddd | … | The code looks like: <div id="container"> <p>aaaaaaaaaaa</p> <p>bbbbb</p> <p>ccccccccccc</p> <p>dddddddddd</p> ... <p>xxxxxx</p> </div> There is no vertical scrolling and the container width is set in such a way that only two columns are shown. The user scrolls left or right to see the relevant text. What I want is to get the position currently on display, store it (maybe in a cookie) and retrieve it the next time the user opens the page. I think that I need a way of finding out what paragraph is currently the left-top most, but other suggestions are very welcome. Any ideas? btw: this is an internal project, so Mozilla only :-) Thanks Lolo

    Read the article

  • Implement a threading to prevent UI block on a bug in an async function

    - by Marcx
    I think I ran up againt a bug in an async function... Precisely the getDirectoryListingAsync() of the File class... This method is supposted to return an object containing the lists of files in a specified folder. I found that calling this method on a direcory with a lot of files (in my tests more than 20k files), after few seconds there is a block on the UI until the process is completed... I think that this method is separated in two main block: 1) get the list of files 2) create the array with the details of the files The point 1 seems to be async (for a few second the ui is responsive), then when the process pass from point 1 to point 2 the block of the UI occurs until the complete event is dispathed... Here's some (simple) code: private function checkFiles(dir:File):void { if (dir.exists) { dir.addEventListener( FileListEvent.DIRECTORY_LISTING, listaImmaginiLocale); dir.getDirectoryListingAsync(); // after this point, for the firsts seconds the UI respond well (point 1), // few seconds later (point 2) the UI is frozen } } private function listaImmaginiLocale( event:FileListEvent ):void { // from this point on the UI is responsive again... } Actually in my projects there are some function that perform an heavy cpu usage and to prevent the UI block I implemented a simple function that after some iteration will wait giving time to UI to be refreshed. private var maxIteration:int = 150000; private function sampleFunct(offset:int = 0) :void { if (offset < maxIteration) { // do something // call the recursive function using a timeout.. // if the offset in multiple by 1000 the function will wait 15 millisec, // otherwise it will be called immediately // 1000 is a random number for the pourpose of this example, but I usually change the // value based on how much heavy is the function itself... setTimeout(function():void{aaa(++offset);}, (offset%1000?15:0)); } } Using this method I got a good responsive UI without afflicting performance... I'd like to implement it into the getDirectoryListingAsync method but I don't know if it's possibile how can I do it where is the file to edit or extend.. Any suggestion???

    Read the article

  • Calling base Text method on custom TextBox

    - by The Demigeek
    I'm trying to create a CurrencyTextBox that inherits from TextBox. I'm seeing some really weird behavior that I just don't understand. After lots of testing, I think I can summarize as follows: In the class code, when I access base.Text (to get the textbox's text), I'm actually getting the return value of my overridden Text property. I thought the base keyword would ensure that the underlying object's methods get called. To demonstrate: public class cTestTextBox : System.Windows.Forms.TextBox { string strText = ""; public cTestTextBox() { SetVal("AAA"); base.Text = "TEST"; } public override string Text { get { string s = strText; s = "++" + s + "++"; return s; } } public void SetVal(string val) { strText = val; } } Place this control on a form and set a breakpoint on the constructor. Run the app. Hover your mouse over the base.Text expression. Note that the tooltip shows you the value of the overridden property, not the base property. Execute the SetVal() statement and again hover your mouse over the base.Text expression. Note that the tooltop shows you the value of the overridden property, not the base property. How do I reliably access the Text property of the textbox from which I'm inheriting?

    Read the article

  • Passing HTML form data in the URL on local machine (file://)

    - by atzz
    Hi, I'm building a small HTML/JS application for primary use on local machine (i.e. everything is accessed via file:// protocol, though maybe in the future it will be hosted on a server within intranet). I'm trying to make a form with method="get" and action="target.html", in the hope that the browser will put form data in the URL (like, file://<path>/target.html?param1=aaa&param2=bbb). However, it's not happening (target.html opens fine, but no parameters is passed). What am I doing wrong? Is it possible to use forms over file:// at all? I can always build the url manually (via JS), but being lazy I'd prefer the browser do it for me. ;) Here is my sample form: <form name='config' action="test_form.html" method="get" enctype="application/x-www-form-urlencoded"> <input type="text" name="param1"> <input type="text" name="param2"> <input type="submit" value="Go"> </form>

    Read the article

  • CodeIgniter URI routing (dynamic, multilingual)

    - by koteko
    I'm trying to redirect all routs to one main controller. Here is my routes.php $route['default_controller'] = "main"; $route['scaffolding_trigger'] = ""; //$route['(\w{2})/(.*)'] = '$2'; //$route['(\w{2})'] = $route['default_controller']; $route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1"; $route['(:any)'] = $route['default_controller']."/index/$1"; I need language id to be passed with every link (like: http://site.com/en/hello-world) Here is my main controller: class Main extends Controller { function __construct() { parent::Controller(); } function index($page_type=false, $param=false) { die($page_type.' | '.$param.'| Aaa!'); } } I want to check if predefined file type exists (like: http://site.com/en/archive/05-06-2010 - here predefined type would be archive) then do something. If not then search in the database for slug. If not found then go to 404. The problem is that I can't get index function parameters ($page_type, $param). Thanks for help.

    Read the article

  • dynamic HREF attribute by XSLT

    - by ofortuna
    Can anyone plese advice how I can have dynamic HREF attribute in the place of http://abc.com by XSLT in following code snippet? <xsl:for-each select="MenuItems/mainmenu"> <a href="http://abc.com"> <span><xsl:value-of select="menuName"/></span> </a> </xsl:for-each> sample xml <MenuItems> <mainmenu> <menuID>1</menuID> <menuName>Home</menuName> <menuLink>http://aaa.com</menuLink> <subMenuList> <menuID>2</menuID> <menuName>Home</menuName> <menuLink>http://a1.com</menuLink> </subMenuList> <subMenuList> <menuID>3</menuID> <menuName>List of RCCs</menuName> <menuLink>http://a2.com</menuLink> </subMenuList> <subMenuList> <menuID>4</menuID> <menuName>Turnover Workout</menuName> <menuLink>http://a3.com</menuLink> </subMenuList> </mainmenu> <MenuItems>

    Read the article

  • setImageViewResource Sometimes loads image and sometimes it doesn't.

    - by Niv
    Hi All, I'm writing a simple widget which has an imageview widget that is supposed to load an image dynamically. To do this, I'm starting a service in the onUpdate method of the service. I validated that the service is running, however, the image is loaded only once every 10 times. Here is the code: (In the Original extends AppWidgetProvider) @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.d(LOG_TAG, "onUpdate(): Starting Service..1"); context.startService(new Intent(context, UpdateService.class)); } (The service:) @Override public void onStart(Intent intent, int startId) { Log.d(LOG_TAG, "(OnStart) In On Start..!"); AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this); int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(this, Original.class)); for (int appWidgetId : appWidgetIds) { RemoteViews remoteView = new RemoteViews(this.getPackageName(), R.layout.widget); remoteView.setImageViewResource(R.id.widgetImage, R.drawable.let02); remoteView.setTextViewText(R.id.widget_textview_month, "aaa"); Log.d(LOG_TAG, "(OnUpdate) Set All Fields!"); appWidgetManager.updateAppWidget(appWidgetId, remoteView); } //super.onStart(intent, startId); return; }

    Read the article

  • I want to insert a text in p tag returning string tinyMCE through jquery

    - by user749884
    I want to insert a text in last p tag which is returning from tinyMCE by the following code var html = tinyMCE.activeEditor.getContent(); For this I am using the following jquery code tinyMCE.init({ mode : "textareas", theme : "advanced" }); $(document).ready(function(){ $("a[title='click_to_add']").click(function() { var html = tinyMCE.activeEditor.getContent(); html = $("#p:last").text(); alert(html); name = $(this).html(); content = html+" "+name; tinyMCE.activeEditor.setContent(content); return false; }); }); But it is not working.The HTML code is given below <div style="float:left;"> <textarea id="mail_body" name="mail_body" rows="15" cols="80" style="width:575px;"></textarea> </div> <div id="aaa"> <a href="#" id="news_user" title="click_to_add"> < name > </a> </div> Please give us a solution for this problem.

    Read the article

  • JustMock is here !!

    - by mehfuzh
    As announced earlier by Hristo Kosev at Telerik blogs , we have started giving out JustMock builds from today. This is the first of early builds before the official Q2 release and we are pretty excited to get your feedbacks. Its pretty early to say anything on it. It actually depends on your feedback. To add few, with JustMock we tried to build a mocking tool with simple and intuitive syntax as possible excluding more and more noises and avoiding any smell that can be made to your code [We are still trying everyday] and we want to make the tool even better with your help. JustMock can be used to mock virtually anything. Moreover, we left an option open that it can be used to reduce / elevate the features  just though a single click. We tried to make a strong API and make stuffs fluent and guided as possible so that you never have the chance to get de-railed. Our syntax is AAA (Arrange – Act – Assert) , we don’t believe in Record – Reply model which some of the smarter mocking tools are planning to remove from their coming release or even don’t have [its always fun to lean from each other]. Overall more signals equals more complexity , reminds me of 37 signals :-). Currently, here are the things you can do with JustMock ( will cover more in-depth in coming days) Proxied mode Mock interfaces and class with virtuals Mock properties that includes indexers Set raise event for specific calls Use matchers to control mock arguments Assert specific occurrence of a mocked calls. Assert using matchers Do recursive mocks Do Sequential mocking ( same method with argument returns different values or perform different tasks) Do strict mocking (by default and i prefer loose , so that i can use it as stubs) Elevated mode Mock static calls Mock final class Mock sealed classes Mock Extension methods Partially mock a  class member directly using Mock.Arrange Mock MsCorlib (we will support more and more members in coming days) , currently we support FileInfo, File and DateTime. These are few, you need to take a look at the test project that is provided with the build to find more [Along with the document]. Also, one of feature that will i will be using it for my next OS projects is the ability to run it separately in  proxied mode which makes it easy to redistribute and do some personal development in a more DI model and my option to elevate as it go.   I’ve surely forgotten tons of other features to mention that i will cover time but  don’t for get the URL : www.telerik.com/justmock   Finally a little mock code:   var lvMock = Mock.Create<ILoveJustMock>();    // set your goal  Mock.Arrange(() => lvMock.Response(Arg.Any<string>())).Returns((int result) => result);    //perform  string ret =  lvMock.Echo("Yes");    Assert.Equal(ret, "Yes");  // make sure everything is fine  Mock.Assert(() => lvMock.Echo("Yes"), Occurs.Once());   Hope that helps to get started,  will cover if not :-).

    Read the article

< Previous Page | 17 18 19 20 21 22 23  | Next Page >