Search Results

Search found 214 results on 9 pages for 'kai wang'.

Page 5/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • jQuery sortable Div's

    - by kai lange
    is it possible to sort direct between two or more div's/boxe's and return the complete data (var order = ...) ? Online Demo: http://jsbin.com/alegu4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery Dynamic Drag'n Drop</title> <script type="text/javascript" src="http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"></script> <style> body { font-family: Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 10px; } ul { margin: 0; } #s1,#s2 { float: left; width: 400px; } #s1 li,#s2 li { list-style: none; margin: 0 0 4px 0; padding: 10px; background-color:#00CCCC; border: #CCCCCC solid 1px; color:#fff; } </style> <script type="text/javascript"> $(document).ready(function(){ $(function() { $("#s1 ul,#s2 ul").sortable({ opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; //$.post("updateDB.php", order); alert(order); } }); }); }); </script> </head> <body> <div id="box"> <div class="box" id="s1"> <ul> <li id="recordsArray_1">1. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_2">2. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_3">3. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_4">4. Lorem ipsum dolor sit amet, consetetur</li> </ul> </div> <div class="box" id="s2"> <ul> <li id="recordsArray_5">5. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_6">6. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_7">7. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_8">8. Lorem ipsum dolor sit amet, consetetur</li> </ul> </div> </div> </body> </html> Please note it's not the same like my other post - thanks!

    Read the article

  • How to implement a good system for login/out into a webapp

    - by Brandon Wang
    I am one of the developers at PassPad, a secure password generator and username storage system. We're still working on it, but I have a few questions on the best way to implement a secure login/out system. Right now, what we plan on doing is to have the login system save a cookie with the username and a session key, and that's all that serves as authentication. The server verifies the two to match. Upon login/out a new key is created. This is a security-related webapp and while we don't actually store any information that might make the user queasy, because it is security-oriented it makes it a necessity for us to at least appear secure in a way that the user would be happy with. Is there a better way to implement a login/out system in PHP? Preferably it won't take too much coding time or server resources. Is there anything else I need to implement, like brute-force protection, etc? How would I go about that?

    Read the article

  • How does the rsync algorithm correctly identify repeating blocks?

    - by Kai
    I'm on a personal quest to learn how the rsync algorithm works. After some reading and thinking, I've come up with a situation where I think the algorithm fails. I'm trying to figure out how this is resolved in an actual implementation. Consider this example, where A is the receiver and B is the sender. A = abcde1234512345fghij B = abcde12345fghij As you can see, the only change is that 12345 has been removed. Now, to make this example interesting, let's choose a block size of 5 bytes (chars). Hashing the values on the sender's side using the weak checksum gives the following values list. abcde|12345|fghij abcde -> 495 12345 -> 255 fghij -> 520 values = [495, 255, 520] Next we check to see if any hash values differ in A. If there's a matching block we can skip to the end of that block for the next check. If there's a non-matching block then we've found a difference. I'll step through this process. Hash the first block. Does this hash exist in the values list? abcde -> 495 (yes, so skip) Hash the second block. Does this hash exist in the values list? 12345 -> 255 (yes, so skip) Hash the third block. Does this hash exist in the values list? 12345 -> 255 (yes, so skip) Hash the fourth block. Does this hash exist in the values list? fghij -> 520 (yes, so skip) No more data, we're done. Since every hash was found in the values list, we conclude that A and B are the same. Which, in my humble opinion, isn't true. It seems to me this will happen whenever there is more than one block that share the same hash. What am I missing?

    Read the article

  • Is it possible to unit test methods that rely on NHibernate Detached Criteria?

    - by Aim Kai
    I have tried to use Moq to unit test a method on a repository that uses the DetachedCriteria class. But I come up against a problem whereby I cannot actually mock the internal Criteria object that is built inside. Is there any way to mock detached criteria? Test Method [Test] [Category("UnitTest")] public void FindByNameSuccessTest() { //Mock hibernate here var sessionMock = new Mock<ISession>(); var sessionManager = new Mock<ISessionManager>(); var queryMock = new Mock<IQuery>(); var criteria = new Mock<ICriteria>(); var sessionIMock = new Mock<NHibernate.Engine.ISessionImplementor>(); var expectedRestriction = new Restriction {Id = 1, Name="Test"}; //Set up expected returns sessionManager.Setup(m => m.OpenSession()).Returns(sessionMock.Object); sessionMock.Setup(x => x.GetSessionImplementation()).Returns(sessionIMock.Object); queryMock.Setup(x => x.UniqueResult<SopRestriction>()).Returns(expectedRestriction); criteria.Setup(x => x.UniqueResult()).Returns(expectedRestriction); //Build repository var rep = new TestRepository(sessionManager.Object); //Call repostitory here to get list var returnR = rep.FindByName("Test"); Assert.That(returnR.Id == expectedRestriction.Id); } Repository Class public class TestRepository { protected readonly ISessionManager SessionManager; public virtual ISession Session { get { return SessionManager.OpenSession(); } } public TestRepository(ISessionManager sessionManager) { } public SopRestriction FindByName(string name) { var criteria = DetachedCriteria.For<Restriction>().Add<Restriction>(x => x.Name == name) return criteria.GetExecutableCriteria(Session).UniqueResult<T>(); } } Note I am using "NHibernate.LambdaExtensions" and "Castle.Facilities.NHibernateIntegration" here as well. Any help would be gratefully appreciated.

    Read the article

  • UISlider disappearing when calling setValue with 0

    - by Kai
    I have several UISliders in my application which all work fine until I call the following code: ... frame = CGRectMake(43, 210, 201, 23); mySlider = [[UISlider alloc] initWithFrame:frame]; [mySlider addTarget:self action:@selector(sliderUpdate:) forControlEvents:UIControlEventValueChanged]; mySlider.minimumValue = 0.0; mySlider.maximumValue = 1.0; mySlider.continuous = YES; tempNum = [myArray objectAtIndex:2]; mySlider.value = [tempNum floatValue]; // only breaks if value is 0 [self.view addSubview:mySlider]; ... For some reason the slider doesn't show up unless mySlider.value is set to greater than 0. The only workaround I've found so far is to set it to an extremely small value (such as 0.000000001), which makes the slider appear as expected. Does anyone have any idea why this might be happening and how it can be fixed?

    Read the article

  • Blackberry application works in simulator but not device

    - by Kai
    I read some of the similar posts on this site that deal with what seems to be the same issue and the responses didn't really seem to clarify things for me. My application works fine in the simulator. I believe I'm on Bold 9000 with OS 4.6. The app is signed. My app makes an HTTP call via 3G to fetch an XML result. type is application/xhtml+xml. In the device, it gives no error. it makes no visual sign of error. I tell the try catch to print the results to the screen and I get nothing. HttpConnection was taken right out of the demos and works fine in sim. Since it gives no error, I begin to reflect back on things I recall reading back when the project began. deviceside=true? Something like that? My request is simply HttpConnection connection = (HttpConnection)Connector.open(url); where url is just a standard url, no get vars. Based on the amount of time I see the connection arrows in the corner of the screen, I assume the app is launching the initial communication to my server, then either getting a bad result, or it gets results and the persistent store is not functioning as expected. I have no idea where to begin with this. Posting code would be ridiculous since it would be basically my whole app. I guess my question is if anyone knows of any major differences with device versus simulator that could cause something like http connection or persistent store to fail? A build setting? An OS restriction? Any standard procedure I may have just not known about that everyone should do before beginning device testing? Thanks

    Read the article

  • Silverlight MVVM example which does not use data grids?

    - by Aim Kai
    I was wondering if anyone knew of a great example of using the MVVC pattern for a Silverlight application that does not utilise a data grid? Most of the examples I have read see links below and books such as Pro WPF and Silverlight MVVM by Gary Hall use a silverlight application with a datagrid. Don't get me wrong, these are all great examples. See also: MVVM: Tutorial from start to finish? http://www.silverlight.net/learn/tutorials/silverlight-4/using-the-mvvm-pattern-in-silverlight-applications/ However some recent demo projects I have been working are not necessarily dealing with data grids but I would still want to implement this pattern..

    Read the article

  • Read VB binary file with c# (knowing the structure)

    - by Kai
    I'd like to read a file that has been binary saved by a vb prog. the file should be read line by line, 'cause every single line represents an object with many attributes. a link looks the following: 999011011/10/1 ELW the structure of data types is: Public Type FahrzeugDAT Kennung As String * 8 Name As String * 30 Info As String * 50 StatusFzg As Integer DatumFzg As Date StatusLst As Integer DatumLst As Date TKI As Integer Folgetlg As Integer LstKurztext As String * 100 FME1 As String * 5 FME2 As String * 5 FME3 As String * 5 DME1 As String * 8 DME2 As String * 8 DME3 As String * 8 Bemerkung As String * 256 Art As Long Standort As Long End Type

    Read the article

  • How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice.

    - by Eric Wang
    How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice. If not use Ajax, it maybe much easier, just return View, but if use AJAX, what data structure should return?I just use Json to return the data, but i found each JSON data model return to the client browser, the JS have to use different code to parse it, remove the originally table rows, add the new data rows(because the column is different) etc. It make me crazy, is there any better way to do that? Thank you for any advice.

    Read the article

  • Android: MediaPlayer gapless or seamless Video Playing

    - by John Wang
    I can play the videos fine back to back by implementing the OnCompletionListener to set the data source to a different file. No problems there. I call reset() and prepare() just fine. What I haven't been able to figure out, is how to get rid of the 1-2 second gap screen flicker between the data source change and the new video starting. The gap shows a black screen, and I haven't found any way to get around it. I've tried setting the background of the parent view to an image, but it manages to bypass that. Even if the SurfaceView is transparent (which it is by default.) I've also tried to have the multiple video files played at the same time, and switching mediaplayer's display when one ends and the other is supposed to start. The last thing I tried, was to have a second view in the background that I show temporarily while the video is "preparing" and removing it when the video is ready to start. That also wasn't very seamless. Is there any way to get rid of that gap. Running a video in a loop works wonderfully and does exactly what I want with the exception that it's looking through the same video instead of playing a different one that I pick. main.xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="@drawable/background" android:layout_height="fill_parent"> <SurfaceView android:id="@+id/surface" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center"> </SurfaceView> </FrameLayout> Player.java public class Player extends Activity implements OnCompletionListener, MediaPlayer.OnPreparedListener, SurfaceHolder.Callback { private MediaPlayer player; private SurfaceView surface; private SurfaceHolder holder; public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main); surface = (SurfaceView)findViewById(R.id.surface); holder = surface.getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void onCompletion(MediaPlayer arg0) { File clip = new File(Environment.getExternalStorageDirectory(),"file2.mp4"); playVideo(clip.getAbsolutePath()); } public void onPrepared(MediaPlayer mediaplayer) { holder.setFixedSize(player.getVideoWidth(), player.getVideoHeight()); player.start(); } private void playVideo(String url) { try { File clip = new File(Environment.getExternalStorageDirectory(),"file1.mp4"); if (player == null) { player = new MediaPlayer(); player.setScreenOnWhilePlaying(true); } else { player.stop(); player.reset(); } player.setDataSource(url); player.setDisplay(holder); player.setOnPreparedListener(this); player.prepare(); player.setOnCompletionListener(this); } catch (Throwable t) { Log.e("ERROR", "Exception Error", t); } }

    Read the article

  • How do I use the html 'title' attribute with Html.Encode()?

    - by Kai
    Hello, I've been tryin to find an example of the syntax for getting an html 'title' for a string when using Html.Encode(). I want to display the full name in the mouseover title, if it's too long. Is there a way to do this without wrapping the string in a < span , i.e. <span title = "<%=Html.Encode(model.Name) %>"> //displays the full name on mouseover <%=Html.Encode(model.Name.Substring(0, 10))%>... //displays the name up to a max length </span> Or should I just do it this way? Thanks!

    Read the article

  • Programmatically set ICQ status

    - by Kai
    I'd like to edit/set icq status with a c# app when a certain action occurs. I know there's an API that seems much too oversized for that. Can someone suggest a better way e.g. manipulating a registry value or something? How would you do this?

    Read the article

  • Blackberry Asynchronous HTTP Requests - How?

    - by Kai
    The app I'm working on has a self contained database. The only time I need HTTP request is when the user first loads the app. I do this by calling a class that verifies whether or not a local DB exists and, if not, create one with the following request: HttpRequest data = new HttpRequest("http://www.somedomain.com/xml", "GET", this); data.start(); This xml returns a list of content, all of which have images that I want to fetch AFTER the original request is complete and stored. So something like this won't work: HttpRequest data = new HttpRequest("http://www.somedomain.com/xml", "GET", this); data.start(); HttpRequest images = new HttpRequest("http://www.somedomain.com/xmlImages", "GET", this); images.start(); Since it will not treat this like an asynchronous request. I have not found much information on adding callbacks to httpRequest, or any other method I could use to ensure operation 2 does not execute until operation 1 is complete. Any help would be appreciated. Thanks

    Read the article

  • Flash - playing video

    - by Yippie-Kai-Yay
    Hello! I'm developing a Flash-only application and I want to integrate the flowplayer directly into it, but not on the webpage using some swfobject-like approach. So, at some moment (for example, when arbitrary event fires), I would like to add the flowplayer object to the scene so that it starts streaming the specified video. Does someone know if that is possible? Would the following API (http://releases.flowplayer.org/apidoc-latest/index.html) help me somehow? Thank you.

    Read the article

  • UI fonts and languages

    - by Kai Sellgren
    I am developing a multilingual web application that has a nice looking UI. I thought using CSS 3's font-face property to make it even nicer UI, but I'm not really sure if that's a good idea. According to some people I have talked to, different languages need different fonts. This means that there is no single font that can display characters of all languages, because the same character may look different across languages. For example, according to Wikipedia, the Unicode code point U+4EE4 looks different in Korean and Japanese languages. So my question is, would it make most sense to contain the fonts within the language packs -- or within the themes of my UI?

    Read the article

  • Replace xml tag with regex

    - by Kai
    How can I replace a certain part in a xml file with a definied string? <tag1></tag2> <tag2></tag2> ...etc <soundcard num=0> <name>test123</name> </soundcard> <soundcard num=1> <name>test123</name> </soundcard> <soundcard num=2> <name>test123</name> </soundcard> <tag5></tag5> replace all soundcard parts that the result looks like that: <tag1></tag2> <tag2></tag2> ...etc {0} <tag5></tag5> I'm using c# .net 3.5 and I thougt of a regex solution

    Read the article

  • dynamically change bitmap in imageView, android

    - by Junfei Wang
    All, I have a problem related to imageView, android. I have array which contains of 10 bitmap objects, called bm. I have a imageView, called im. Now I wanna show the bitmaps in the array in im one by one, so I did the following: new Thread(new Runnable() { public void run() { for(int j=0;j<10;j++){ im.setImageBitmap(bm[j]); } } }).start(); But the result only shows the last bitmap in the array. Can someone tell me what to do with this issue? Millions of thanks!

    Read the article

  • Eclipse autocomplete (content assist) with jsf2.0, xhtml and primefaces 2.2.RC1

    - by Keating Wang
    I use windows 7. I set the ClassPath like this: D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-api.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-impl.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\primefaces-2.2.RC1.jar And I alse do this: Window Preferences General Content Types Text JSP Add (xhtml) But, it doesn't works. When I use netbeans. I do nothing, but the autocomplete function works well.

    Read the article

  • Are there built-in issue tracking and task management in IDEs that integrate into SourceForge, Googl

    - by Kai Sellgren
    Hi, This question may not be exactly programming related, but this is about development. I have been trying to find IDEs that support JIRA/Bugzilla so that I could simply integrate the IDE with SourceForge. I do not like to refresh my browser to see issues, bug reports, security problems, etc. I would like to send issues, resolve issues, right from the IDE. I am currently developing with NetBeans, but I see no ways of integrating into any of the services provided by SourceForge. Am I missing something?

    Read the article

  • How can I get JUnit test (driven from Ant script) to dump the stack of exception that causes failure

    - by Matt Wang
    We run JUnit test from Ant script, as follows. When the test failed, I expect it to output the stack dump of the exception that casuses the failure, but it doesn't. Is there any trick to get it dumped? <target description="Run JUnit tests" name="run-junit" depends="build-junit"> <copy file="./AegisLicense.txt" tofile="test/junit/classes/AegisLicense.txt" overwrite="true"/> <junit printsummary="yes" haltonfailure="no" fork="yes" forkmode="once" failureproperty="run-aegis-junit-failed" showoutput="yes" filtertrace="off"> <classpath refid="Aegisoft.testsupport.classpath"/> <classpath> <pathelement location="test/junit/classes"/> </classpath> <batchtest> <fileset dir="test/junit/src"> <include name="**"/> </fileset> </batchtest> </junit> <fail

    Read the article

  • Determining linkage dependencies in Flex applications

    - by Kai
    I have a large Flex project with two Applications in it. A lot of code is shared between these Applications. However, the smaller of the Applications does not require much of the code that the larger one does. I'm trying to ensure that code that isn't required by the smaller application isn't getting compiled into it. Is there an easy way for me to determine which files within my project are being compiled into a particular Application?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >