Posts

Showing posts from August, 2013

Windows authentication denied asp.net -

i have tried search stack overflow time answer question without success. i have asp.net mvc3 application windows authentication. because of logging have know using application when access it, , therefore users being prompted typical login dialog when enter page can see using application. when user enters his/her nt logging details system accept credentials , lets them use page. getting different information users active directory. the page on intranet , being accessed computer logged on domain webpage denies, how prompting when user first enters page, , user enters his/her nt details mentioned earlier. my problem system sometimes keeps denying users when try login computers. i have checked of different things such anonymous identification , forth , shouldn't problems @ all. i need place can see perhaps events or other log why being denied. this how checking of roles has been made: public class financialreportcontroller : baseemployeecontroller { . [autho

javascript - Get focus textarea id after click -

i need obtain textarea id focused when clicked element. i use $(':input:focus').attr('id') , after click textarea looses focus immideatly , cann't obtain id of textarea selected. could help? you can use .focusout() method: $('#focuseditem').focusout(function() { var id = $(this).attr('id'); });

deployment - how to deploy rails project with RAILS_GEM_VERSION = '2.3.8' -

i want run rails project having rails_gem_version = '2.3.8' have of running project rails version 3.2.11....how proceede edit gemfile , replace rails gem line : gem "rails", "2.3.8"

object - Javascript datatypes visual -

Image
i'm making visual reference of javascript myself , likes have when it's done, better understanding of core javascript. now i'm not sure if got datatypes part right, i'm basing visual on book "javascript definitive guide" so glad hear if structure right. revised version of visual: your structure right. javascript has 5 primitive data types: string, number, boolean, undefined, , null. object, array , functions compositive datatypes. link might helpful clear thoughts. data types in javascript objects contain properties , methods; arrays contain sequential list of elements; , functions contain collection of statements.a function data type in javascript, not common in many other programming languages. means can treated containing values can changed. makes them composite data types. also, javascript not have class "class" in java or python. prototyped object.

oracle - SQL "Where" syntax for is today -

i need entrys curdate today... curdate of type timestamp . of course searched in google think have used wrong keywords. select * ftt.element fee, ftt.plan p p.id=ftt.p_id , curdate ??? order p_id, curdate desc; could provide me? sysdate returns current datea and time in oracle. date column contains time part in oracle - timestamp column well. in order check "today" must remove time part in both values: select * ftt.element fee join ftt.plan p on p.id=ftt.p_id trunc(curdate) = trunc(sysdate) order p_id, curdate desc; you should used using explicit join s instead of implicit joins in where clause. if need take care of different timezones (e.g. because curdate timestamp time zone ) might want use current_timestamp (which includes time zone) instead of sysdate

How to connect MS SSMS Express to server (Integrated Security) -

Image
i'm trying connect via ssms our ms sql server 2005. first tried connect via visual studio programmatically. worked after found out have put "integrated security=sspi;" connection string, otherwise refused connection "login failed" error. now im trying connect via ssms refuse when try connect. sadly there no option can set "integrated security=sspi" or else. choosing "windows authentication" option in connection dialog ssms equivalent putting "integrated security=sspi" in connection string. this use credentials of ssms process when connecting server. as note can achieve same result using "additional connection parameters" text box. click on "options >>" button @ bottom of connection dialog , select "additional connection parameters" tab. then enter in text "integrated security=sspi" (without quotes) text box. override whatever authentication option chosen in drop-

Can't import Android project into Eclipse - Finish button doesn't do anything -

Image
i have downloaded latest actionbarsherlock , trying open in eclipse. after pressing finish button nothing happens. no errors. buttons work if have not pressed finish button. can return or refresh or check checkbox. my path has no spaces. actioncarsherlock requires adt version 0.9.7 have found following version of software in eclipse. android development tools 21.1.0.v201302060044-569685 com.android.ide.eclipse.adt.feature.group android open source project ps eclipse update has not helped me (updating sdk) ps android sdk update fixed it i came across problem yesterday. i had updated adt plugin without updating android sdk tools , platform-tools. so make sure of above up-to-date.

css - Rounded Corners Not Displaying in Safari -

i work on pc hadn't realized having problem. basically, rounded corners of container not displaying in safari, strange because believe code used compatible safari. input on appreciated. here's container code: .container { clear: both; margin: 20px auto; width: 940px; background: #fff; -moz-border-radius: 10px; -khtml-border-radius: 10px; -webkit-border-radius: 10px; -moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3); -khtml-box-shadow: 0px 0px 8px rgba(0,0,0,0.3); -webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3); position: relative; z-index: 90; /* stack order: displayed under ribbon rectangle (100) */ /* overflow-x: hidden; */ *zoom: 1; } and website wrapped in it: <div class="container"> website </div> if have safari, can view issue here . your problem you've got prefixed versions of border-radius , haven't got standard un-prefixed version. you need add border-radius: 10px; yes, safari webkit br

suse - SIGILL with code 2 when C++ method returns on SLES11 -

in 1 of test program have method call returns string object. xms::string propval = connfact->getstringproperty("prop_name"); xms::string class representing string. when test code runs on suse linux 11, sigill code 2 after getstringproperty method returns , before assigning return value propval . ideally copy constructor of xms::string should have been called sigill. what reason? happens on sues linux 11, not on other os windows or aix or rhel.

php - RewriteRule only for specific pattern if 404 error would occur -

i'm trying update .htaccess-file goal, pages have responded "404 file not found"-error rewritten url. example: i've got 3 links: 404 : domain.com/category1/123-article-name.html working : domain.com/static-page/10-ways-to-destroy-your-webpage.html untouched : domain.com/simple-website.html in case first link should redirected domain.com/lost/123-article-name.html , second 1 allready works. third link should never affected rule. hope guys can me. that's hard nut crack, me! thank you! edit: rewriterule ^(.*)/([0-9]+)-(.+).html$ lost/$2-$3.html [l] this i've got far, rule kind of "stupid", because not test wheater requested page exists or not. your rule , rules cms mutually exclusive. line 41 (your rule) execute if file exists, because if file doesn't exist (rewriteconds on line 38 , 39) server tries return index.php?page=path_name generate 404 error. if know names of categories/directories missing, per lines 10

Multiple AngularJS directives with different scopes -

hi have 2 popup directives on same page. problem when click on 1 both pop up. how can isolate each scope each other popup that's clicked pops up? html <popup class="popup"> <trigger> <a href="#" data-ng-click="showpopup()">show popup</a> </trigger> <pop> popped </pop> </popup> <popup class="popup"> <trigger> <a href="#" data-ng-click="showpopup()">show popup</a> </trigger> <pop> popped </pop> </popup> popup.js angular.module('sembaapp') .directive('popup', function () { return { restrict: 'e', replace: true, transclude: true, template: '<div data-ng-transclude></div>', controller: function postlink($scope, $element, $attrs) { $scope.popup = false; $scope.showpopup = function() {

Extracting strings from text file -

i have file compile2.txt following data in it: compile log of application: information version: 1.0 revision: 940 compile date/time: 04/02/2013 05:03:16 elapsed time: 5.53 seconds summary: total of 917 steps , 127 objects compiled. total errors(0) , warnings(0). --- end of compile report --- i need extract application, revision , date/time information using batch file. how can achieve this? expected output should follows: information 940 04/02/2013 05:03:16 @echo off setlocal enabledelayedexpansion /f "tokens=*" %%a in (compile2.txt) ( set linec=%%a set linetest=!linec:compile log of application=! if not [!linec!]==[!linetest!] set app=!linec:compile log of application: =! set linetest=!linec: revision=! if not [!linec!]==[!linetest!] set rev=!linec:version: 1.0 revision: =! set linetest=!linec:compile date/time: =! if not [!linec!]==[!linetest!] set when=!linec:compile date/time: =! ) echo !app! - !rev! @

cordova - I cannot send image in .net webservice using javascript -

this code please me code... web service in .net how pass image using java script , in .net web service , store in folder , again. had tried min. 3 hours failed solution please me... // wait cordova load // document.addeventlistener("deviceready", ondeviceready, false); // cordova ready // function ondeviceready() { // retrieve image file location specified source navigator.camera.getpicture(uploadphoto, function(message) { alert('get picture failed'); }, { quality: 50, destinationtype: navigator.camera.destinationtype.file_uri, sourcetype: navigator.camera.picturesourcetype.photolibrary } ); } function uploadphoto(imageuri) { var options = new fileuploadoptions(); options.filekey="file"; options.file

Equality in Python's list-comprehension -

i have forgotten equalities in python's list-comprehension [str(a)+str(b)+str(c) in range(3) b in range(3) c in range(3)] ['000', '001', '002', '010', '011', '012', '020', '021', '022', '100', '101', '102', '110', '111', '112', '120', '121', '122', '200', '201', '202', '210', '211', '212', '220', '221', '222'] where want make restriction a!=b , b!=c. for a!=b b!=c @ end did not work. how have equality constraint in list-comprehension? something this: ["{}{}{}".format(a,b,c) in range(3) b in range(3) c in range(3) if a!=b , b!=c] or better use itertools.product : >>> itertools import product >>> ["{}{}{}".format(a,b,c) a, b, c in product(range(3), repeat=3)

javascript - Loop in html table and check if a radio is selected -

i want javascript or jquery function searches in html table , if no radio selected notify user.i have table id , don't know radio id(s). you can use is() returns boolean: if (!$('table :radio').is(':checked')) { alert('no radio button selected'); } if @ least 1 radio button checked, won't fired alert()

c - how to make loop in this case? -

i need compute first 100 prime numbers, in output got "9" , other in numbers....................... want compute first 100 prime numbers { bool prime; int start, new, kor,k, i,gg; start=1; k=1 ; gg=0; { if (start < 2) {new = 2;} if (start == 2) {new = 3;} if (start > 2) { if ((new % 2) == 0) new--; { prime = true; kor=sqrt(new); new+=2; (i=3;prime&& (i<=kor); i+=2) { if (new % == 0) prime=false;} } while (!prime) ; } gg++; printf("%d->%d\n",gg, new); k++; start++; continue; } while (k<101); } with if (start < 2) {new = 2;} if (start == 2) {new = 3;} you have special cases first , second numbers. next time round do...while loop skip loop because kor 1, thereby printing 5. didn't check, perhaps got lucky. smells don'

Replacing the last character in a string javascript -

how replace last character of string? setcookie('pre_checkbox', "111111111111 11 ") checkbox_data1 = getcookie('pre_checkbox'); if(checkbox_data1[checkbox_data1.length-1]==" "){ checkbox_data1[checkbox_data1.length-1]= '1'; console.log(checkbox_data1+"after"); } out put on console : 111111111111 11 after last character not replaced '1' dont know why also tried : checkbox_data1=checkbox_data1.replace(checkbox_data1.charat(checkbox_data1.length-1), "1"); could 1 pls me out simple regex replace should want: checkbox_data1 = checkbox_data1.replace(/.$/,1); generic version: mystr = mystr.replace(/.$/,"replacement"); remember calling str.replace() doesn't apply change str unless str = str.replace() - is, apply replace() function's return value variable str

html - Can you embed VLC on a website so that people who doesn't have VLC installed can view it? -

i trying make video streaming site , want use vlc play video. however, want other people doesn't have vlc able view videos through vlc plugin. possible? want use vlc because can play anything. the viewer has have vlc , browser plugin installed on there pc, depending on file format of video use html5 video tag. <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> browser not support video tag. update browser. </video> this work if viewer has html5 ready browser meaning old versions of ie wont able see video code tell them have update there browser

.htaccess - URL Rewriting in Wordpress htaccess -

i've built wordpress site has product page retrieves product info external system using querystring id passed in. www.domain.com/product/?id=n loads wordpress product page loads product info using id. this works fine. however, want rewrite url that: www.domain.com/product/productname/id retrieves www.domain.com/product/?id=n when add following htaccess, page returns 404 because doesn't exist in wordpress. rewriterule ^product/productname/(.*)$ ^product/?id=$1 [l] does know how write rule in such way doesn't hijacked wordpress rewriting? after doing additional searching, i've found links may started. secret lies in wordpress's add_rewrite_rules hook. haven't tried these myself yet, looks promising: http://codex.wordpress.org/rewrite_api/add_rewrite_rule url rewriting via wordpress rewrite or .htaccess http://www.hongkiat.com/blog/wordpress-url-rewrite/ http://matty.co.za/2009/11/custom-url-rewrites-in-wordpress/

perl - Integrate data table Jquery ui into myycode -

i want integrate table style code. http://www.codeproject.com/articles/277576/ajax-based-crud-tables-using-asp-net-mvc-3-and-jta example in asp.net mvc3 , dont know how in perl code my @arows; $aarray = db::select({ table => 'students', condition => { } }); $i ( 0 .. $#$aarray ) { $crowid = $q->hidden('rowid', $aarray->[$i]->{'id'}); $bt1 = $q->image_button({-src => '/media/images/delete_1.png', -class => 'del', -title => 'delete', -name => 'delete', -value => $aarray->[$i]->{'id'}, $bt2 = $q->image_button({-src => '/media/images/edit_1.png', -class => 'upd', -title => 'update', -name

java - Getting a "must overide supercalss methed" when compiling facebooks sample code -

i'm trying compile sample code facebook sdk. i'm getting errors on lines below @override example on following lines @override public void startactivityforresult(intent intent, int requestcode) i error says the methed startactivityforresult of type new must overide super class type could delete @override whatever class extending assumed have method declaration of startactivityforresult exact return type , parameters. check if following it. can remove @override , work, saying, method doesn't exist in super class. verify class perhaps extending. if method supposed invoked , not, else break.

ffmpeg - Live streaming HLS on Red 5 Media Server on Windows Server -

i trying develop streaming server using red 5 on windows server have 2 clients, web app running on windows 8 pcs , ios app. the problem i'm facing ios supports hls , red 5 supports rtsp/rtmp, need convert incoming streams hls rtsp/rtmp , outgoing streams rtmp/rtsp hls using ffmpeg commands. how go this? should modify red 5 server code or there better alternative?

java - How to a new element to JFrame and have it show -

i have gui scroll pane in it. scroll pane scrolling though jpanel of jpanels. ability add 1 more list of subjpanels , have jframe update it. right have array updating, not jframe. package sscce; import java.awt.borderlayout; import java.awt.dimension; import java.awt.flowlayout; import java.awt.gridlayout; import java.awt.toolkit; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.ioexception; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jscrollpane; import javax.swing.jtextfield; public class add extends jframe{ private jpanel[] branches; private jpanel pane; //pane stores accounts private jscrollpane scroller; private jbutton newbranch; public static void main(string[] args) { jframe frame = new add(); } public add(){ this.setdefaultcloseoperation(jframe.exit_on_close); this.setsize(500, 500);

c++ - AssignProcessToJobObject Failing The Handle is Invalid -

im creating job createjobobjecta(), creating new process createprocessa(), , when try assign new process job have created assignprocesstojobobject() returns 0. getlasterror() , im getting value of 6. according windows systems error code means handle invalid. heres code. handle job = createjobobjecta( null, "jobname" ); if( job == null ) { printf( "job null" ); } else { jobject_extended_limit_information jeli = { 0 }; jeli.basiclimitinformation.limitflags = job_object_limit_kill_on_job_close; if( 0 == setinformationjobobject( job, jobobjectextendedlimitinformation, &jeli, sizeof(jeli))) { printf("could not setinformationjobobject\n"); } } if( createprocessa( "c:\\windows\\syswow64\\cmd.exe", "/c server.bat", null, null, true, 0, null, null, &info, &processinfo)) { printf("createprocess succeeded.\n"); if( job != null ) { handle derp = processinfo.hprocess;

java - regex 3 alphanumeric or 1 asterisk -

can please me regex match group either contains 3 alphanumeric characters or 1 asterisk character? any of 01a a12 a12 01a etc or * need extract 3 alphanumeric or * whichever present. i tried ([\\w]{3}|[\\*]) ([\\w]{3})|([\\*]) and few others. nothing worked. thanks. i wish you'd have tried first, simple one. can match alphanumeric characters saying [a-za-z0-9] , or can match asterisk escaping \* . use pipe match 1 of several alternatives (a|b|cde) , , can put number in braces match more 1 of a{2} . so, should find answer. if try put on own, we'll along if have issues.

String manipulation in Javascript - issue with whitespace -

anybody have advice on following problem? below code. don't know how make program account spaces. thanks! have function abcheck(str) take str parameter being passed , return string true if characters , b separated 3 places anywhere in string @ least once (ie. "lane borrowed" result in true because there 3 characters between , b). otherwise return string false. function abcheck(str){ (var = 0; < str.length; i++) { if (str.charat(i) === "a"){ if (str.charat(i+3) === "b") { return true; } } } return false; } you might have @ regular expressions. here's same function regular expression (it should work, haven't tested yet): function abcheck(str) { return str.replace(" ","").match(/a([\w\w]{2}b)/g) != null; } jsfiddle does work you? also have at: regular expressions - w3c , replace()

ios - create a custom navbar that can handle push actions -

Image
i want (custom buttons in topbar): currently i've implemented custom view buttons. need add support of pushing new controllers clicking these buttons -> , here i've faced: push segues can used when source controller managed instance of uinavigationcontroller.' is possible create custom navbar can handle push actions? in xcode hold ctrl , drag button other view controller , click modal on drop down.

c# - MEF update exported part metadata (the metadata view is invalid because property has a property set method) -

i have application , i'm using mef compose it. want know if possible update metadata information of parts after imported. the reason following: display imported parts' name , typeof(int) property in listbox, , not loaded until corresponding listboxitem selected (pretty standard). want update metadata info of 1 part when event raises, displayed info in listbox somethind "[part name] ([new number])". i'm importing metadata interface defines it's info, when set int property editable (with set accesor) receive following execption @ composition time: "the metadataview 'mymetadatainterface' invalid because property 'myint' has property set method." is there way achieve this? or metadata read once part created? i know question looks weird, doesn't make less difficult , therefore interesting ;-) edit (based on lee's answer, in order keep people core of question) i want know if possible update metadata property a

java - Sending output to external process -

for reason, i'm having problems sending output process i've created in java. external process running in command prompt, , peculiar thing can click that, type, hit enter, , i'll output program. addition program can read output coming program, can't send it. anyways, here relevant code i'm using isn't working... try { processbuilder builder=new processbuilder(args); builder.redirecterrorstream(true); final process p=builder.start(); // process has been created , running try { string b=""; bufferedreader input = new bufferedreader(new inputstreamreader(p.getinputstream())); final bufferedwriter output = new bufferedwriter(new outputstreamwriter(p.getoutputstream())); new thread(){public void run(){ // thread periodically send "get_time" process update on progress while(true) { try { thread.sleep(1000);

32 Bit ALU in VHDL Carry Out -

Image
i'm supposed write simple 32 bit alu in vhdl. working fine, except 2 things. alu supposed have carry out , overflow flag , cant't figure out how implement that. first general question. circuit diagram shows subtraction alu inverts subtrahend , adds "1" create negative equivalent of input value in 2s-complement. mean should work unsigned values input? or should stick std_logic_vector? since carry out bit bit not "fit" result word, tried 0 extend summands, create temporary 33 bit sum signal , divide result carry out , actual sum. unfortunately when simulating "uu...u" output sum.( did described here: https://en.wikibooks.org/wiki/vhdl_for_fpga_design/4-bit_alu ) and overflow flag: since description of alu behavioral don't have access carries, means can't determine if overflow occured xoring last 2 carries(assuming values in 2s-complement, i'm not quite sure in point first question shows...). there way identify overflow? turning

javascript - 170k item array not being processed correctly -

i have fiddle (note: accesses 2k file via jsonp). has small word list @ load consisting of 2 , 3 letter words, loaded array. it's filtered using array.prototype.filter . works. then page starts downloading enable1 word list (used games featuring word list). @ point, filter functions ends empty array, instead of expected 105 words. i can confirm that, both before , after, my word list has same starting word ( aa ) should displayed, the lists have 1091 , 172820 words respectively all words lowercase, , have no surrounding spaces on load, filtering criteria "has 2 letters" there no errors on console there 100mb (25%) increase in fiddle's page's ram usage, system has 35% ram remaining here's code. function vm() { var self = this; self.characters = ko.observable(2); self.words = ko.observablearray(document.getelementbyid("words") .innerhtml.split(/\s+/g).slice(1, -1) .map(function (word) {

mysql - How to I find multiple logs in the same time interval? -

i have table 2 columns of importance, customer id# , timestamp. whenever customer orders something, 5 rows created customer id # , timestamp of when went through. if there more 5 rows, means our system hasn't processed order correctly , there problem, , asked through log find customer ids of people received more 5, how many times received incorrect amount , number received each time (when not 5) i want show me, whenever same customer id (in column "id") has more 5 rows same timestamp (column "stamp") tell me 1. person's customer id 2. how many times irregularity has happened customer id, , 3. how many rows in each irregularity (was 6 or 7... or more? etc.) (if #2 3 times, #3 array { 7, 8, 6 }) i don't know if possible... @ appreciated. thanks! this should of way there: select `customerid`, `timestamp`, count(1) orderitems group `customerid`, `timestamp` having count(1) > 5

c# 4.0 - How to have many consumer threads using BlockingCollection -

i using producer / consumer pattern backed blockingcollection read data off file, parse/convert , insert database. code have similar can found here: http://dhruba.name/2012/10/09/concurrent-producer-consumer-pattern-using-csharp-4-0-blockingcollection-tasks/ however, main difference consumer threads not parse data insert database. bit slow, , think causing threads block. in example, there 2 consumer threads. wondering if there way have number of threads increase in intelligent way? had thought threadpool this, can't seem grasp how done. alternatively, how go choosing number of consumer threads? 2 not seem correct me, i'm not sure best # be. thoughts on best way choose # of consumer threads? the best way choose number of consumer threads math: figure out how many packets per minute coming in producers, divide how many packets per minute single consumer can handle, , have pretty idea of how many consumers need. i solved blocking output problem (consumers bloc

image processing - In batch scripting what does the expression %* expand? -

this question has answer here: what %* mean in batch file 4 answers i have batch script has got line echo %* >> test.txt %process% %* what expression %* denote , expand to? it expands arguments passed in shell/batch file. e.g. foo.bat: echo %* and doing c:\> foo.bat abcefg hijkl 1 2 3 echo abcefg hijkl 1 2 3 abcefg hijkl 1 2 3 c:\>

gnu make - Makefile to support 2 executables -

i trying update makefile support building binary of project, , binary of unit tests. my directory structure following |-code/ |--|--src/ |--|--inc/ | |-tests/ |--|--src/ |--|--inc/ my makefile compiles binary code well, having issues test. test folder contains unit test tests classes in code/src/. have file main.cpp in code/src/ contains main() function, , file, called test.cpp in tests/src contains own main() function. this led me complicated makefile: cc = g++ flags = -g -c -wall includedir = -icode/inc -itests/inc builddir = build sourcedir = code/src sources = $(wildcard $(addsuffix /*.cpp,$(sourcedir))) temp_obj = $(sources:%.cpp=%.o) not_dir = $(notdir $(temp_obj)) objects = $(addprefix $(builddir)/, $(not_dir)) test_dir = tests/src test_sources = $(wildcard $(addsuffix /*.cpp,$(test_dir))) test_temp_obj = $(test_sources:%.cpp=%.o) test_not_dir = $(notdir $(test_temp_obj)) test_objects = $(addprefix $(builddir)/, $(test_not_dir)) executable = client test_executa

function - Find keyword, replace, and loop -

i wrote script find keyword, "s", , perform formula in column 3 columns over. far finds first instance of "s". want continue search , perform formula each line in "s" exists. can me loop below code? much. worksheets("sheet2").activate dim c range set c = range("b:b").find _ (what:="s", lookin:=xlformulas, _ lookat:=xlwhole, searchorder:=xlbyrows, searchdirection:=xlnext, _ matchcase:=false, searchformat:=false) if not c nothing c.offset(0, 3) = c.offset(0, 1) * c.offset(0, 2) * 0.05

java - TomEE chokes on too many @Asynchronous operations -

i using apache tomee 1.5.2 jax-rs, pretty out of box, predefined hsqldb. the following simplified code. have rest-style interface receiving signals: @stateless @path("signal") public class signalendpoint { @inject private signalstore store; @post public void post() { store.createsignal(); } } receiving signal triggers lot of stuff. store create entity, fire asynchronous event. public class signalstore { @persistencecontext private entitymanager em; @ejb private eventdispatcher dispatcher; @inject private event<signalentity> created; public void createsignal() { signalentity entity = new signalentity(); em.persist(entity); dispatcher.fire(created, entity); } } the dispatcher simple, , merely exists make event handling asynchronous. @stateless public class eventdispatcher { @asynchronous public <t> void fire(event<t> event, t parameter) { eve

cocoa - objective-c #import @class -

this question has answer here: @class vs. #import 15 answers i can't use of #import , @class let's try make things clear simple classical example: employee case. i have class employee, class manager , class department. employee superclass of manager , contain object department ( should import department? in employee.h or employee.m , should use #import or @class ? ) department contains array of employees should should import class employee.h ( should use import or class? , where? ) i know theres better way solve problem, using databases or that's not point, want understand when , use #import , , when use @class i tried read similar post didn't understand how works... using @class hint compiler mean use class , can used when referencing class in kind of declaration. not import header file , therefore compile little faster. usefu

asp.net - Performance Issues loading large data set into c# GridView -

ok, been testing relatively small data sets gridview, , has worked fine. however, i've moved proper uat , have tried load 17,000 records grid, has brought web app grinding halt. basically, user logs in, , upon validation data grids loaded, 1 of contains 17k records. until loads end user left handing on logon page. need fix it. the code grids is: datatable dtvaluedatecurrency = null; sqlconnection conn = new sqlconnection(webconfigurationmanager.connectionstrings["reporting"].connectionstring); using (conn) { conn.open(); //load other grid data using (sqldataadapter sqladapter = new sqldataadapter(tsql1, conn)) { dtvaluedatesummary = new datatable(); sqladapter.fill(dtvaluedatesummary); grdvaluedatesummary.datasource = dtvaluedatesummary; grdvaluedatesummary.databind(); } } is there way increase load times? pagination isn't option, i'm taking care of jquery. loading 17,000 re

Spring 2.5 to 3.2 upgrade error: Invalid property 'commandClass' of bean class -

i new spring , upgrading spring 2.5 web app 3.2.3. getting error navigating off front page of app. error invalid property 'commandclass' of bean class. web app has been running 5 years, issue has spring 2.5 3.2 changes. must have wired wrong, ideas? the full error : error creating bean name '/new_candidate.html' defined in servletcontext resource [/web-inf/webapp-servlet.xml]: error setting property values; nested exception org.springframework.beans.notwritablepropertyexception: invalid property 'commandclass' of bean class [org.myorg.app.web.scorechangecontroller]: bean property 'commandclass' not writable or has invalid setter method. parameter type of setter match return type of getter? here bean def webapp-sevlet.xml: <bean name="/new_candidate.html" class="org.myorg.app.web.scorechangecontroller" scope="session"> <property name="commandclass" value="org.myorg.app.mod

javascript - Click on Link using jQuery -

i trying automatically click link when page loads using jquery. have done in past projects, not able work now. here code: <script type="text/javascript"> $(document).ready(function(){ $(".btn-warning").trigger("click"); }); </script> <!-- modal --> <a href="#mymodal2" role="button" class="btn btn-warning" data-toggle="modal">confirm</a> <div id="mymodal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel2" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h3 id="mymodallabel2">alert header</h3> </div> <div class="modal-body"> <p>body goe

c++ - How to resolve differences in methods in the .lib file? -

i trying 3rd party library work code. have source library, , have verified build options match own build options, have not gone though source code learn doing. my code calls line value m_jsonvalroot; gives me following linking errors: linking... 1>jsonwrapper.obj : error lnk2019: unresolved external symbol "public: __cdecl json::value::~value(void)" (??1value@json@@qaa@xz) referenced in function "public: class atl::cstringt<wchar_t,class strtraitmfc_dll<wchar_t,class atl::chtraitsos<wchar_t> > > __cdecl json::cjsonwrapper::runtest(class atl::cstringt<wchar_t,class strtraitmfc_dll<wchar_t,class atl::chtraitsos<wchar_t> > >)" (?runtest@cjsonwrapper@json@@qaa?av?$cstringt@_wv?$strtraitmfc_dll@_wv?$chtraitsos@_w@atl@@@@@atl@@v34@@z) 1>jsonwrapper.obj : error lnk2019: unresolved external symbol "public: __cdecl json::value::value(int)" (??0value@json@@qaa@h@z) referenced in function "public: class atl::cst

Twitter Bootstrap required validation not working -

i'm having difficulty getting twitter bootstraps jqbootstrapvalidation.js work. have included file , have managed validation working on input of form regular expression, field in form trying validate @ moment should simpler : i'm validating required field. the html <textarea class="input-xxlarge" id="desctextarea" rows="2" required="required" data-validation-required-message="you must complete description"/> <p class="help-block"> i've used required without "=required" and javascript have tried $(#desctextarea).not("focus").jqbootstrapvalidation(); and lot of other variations .not("blur") or .on("focusout") or .on("focus") , on , on. the desired behaviour when user clicks out of field , if field empty validation fail , validation failed message appear in help-block. any ideas i'm going wrong? thanks (oh , way - .not() mean?)

objective c - Show, activate and stop indetermined progress indicator -

i'm having issues showing progress indicator whenever button clicked, , stop , hide indicator when nstask completed. this should timeline: 1- button clicked 2- shows progress indicator (from hidden state) 3- activates progress indicator 4- activate associated nstask 5- continue showing indicator until nstask completed 6- after completion of nstask, hide progress indicator. i know how progress indicator animate etc. not know how combine these nstask completing thing.. thanks in advance! use nstask 's terminationhandler property set block execute when task terminates. in block stop/hide progress indicator. addendum (see comments) in rough outline: nstask *mytask = ...; nsprogressindicator *myindicator = ...; mytask.terminationhandler = ^(nstask *thetask) { [myindicator stopanimation:nil]; }; note handler passed nstask in case needs access information it. nil passed sender stopanimation: - pass self cause retain cycle , object invoking method is

jquery - How to change Phone number format in input as you type? -

Image
my codepen: http://codepen.io/leongaban/pen/cyaal i have input field phone number allows 20 characters (for international numbers). i'm using masked input jquery plugin josh bush format phone number in input make 'pretty'. my problem in requirements when phone 10 digits or less, should use masked input formatting. however when phone number longer 10 digits, formatting should removed. here current: codepen , cell phone input field i'm trying accomplish this. work phone example of default functionality of mask input plugin . how go problem? jquery cell phone input field: case '2': console.log('created phone input'); $('.new_option').append(myphone); $('.added_mobilephone').mask('(999) 999-9999? 9'); $('.added_mobilephone').keypress(function(event){ if (this.value.trim().length > 10) { console.log('this.value = '+this.value.trim()); console.log(&#

css - How do I keep a div from wrapping, when the div aligned to it can vary in it's width? -

i have simple setup. div contains title , titleoptions. the title long , have ellipsis instead of showing full title. right of title titleoptions. these can vary. delete, edit , move, few those, none. (the title width therefore cannot fixed, since titleoptions vary). how have 1 line title , titleoptions. don't want wrap ever, or push titleoptions below. i prefer titleoptions width fluid, since allow longer title have more real estate. here fiddle better explanation: http://jsfiddle.net/k8s3z/1 you can use flexbox . .titlebar { width:980px; overflow:hidden; border: 1px solid #eee; margin-bottom:2em; display: -webkit-flex; } .title { border: 1px solid #ddd; white-space:nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-flex: 1; } .titleoptions { white-space:nowrap; border: 1px solid #ddd; } fiddle (which has other syntax , prefixes needed, etc). with js if flexbox not available function getb

objective c - split an existing iOS app project into static library and app skin project -

i split existing ios app project 1 static library , 1 app project. since existing app project has been copies multiple times brand new instances different resources(graphics, icons etc) , settings. i find it's hard maintain across difference instances once core project has been updated. so i'm turning core project static library model, views , third party libraries. the other project contains app part contains customised resources , app settings. the problem how can classes in static library getting app settings app project , main app project calling classes in library. any practise , tools that? the main app project can make use of static library classes through exported header (.h) files. recommend reading bit them here: http://developer.apple.com/library/ios/#technotes/iosstaticlibraries/articles/creating.html and creating static library here: http://www.icodeblog.com/2011/04/07/creating-static-libraries-for-ios/ as for providing app-specifi

table - jQuery with Draggable/Droppable behavior on Over and Out -

i need one. i've been trying hard right can't it.. jsfiddle: http://jsfiddle.net/5vyq8/13/ js-code: $(document).ready(function () { // treetable $("table").treetable({ expandable: true, initialstate: "expanded", expandertemplate: "<a href='#'>&nbsp;&nbsp;&nbsp;&nbsp;</a>", indent: 24, column: 0 }); // draggable $("table .draggable").draggable({ opacity: .75, refreshpositions: true, revert: "invalid", revertduration: 300, scroll: true, delay: 100, cursor: 'move' }); //droppable $("table tbody tr").each(function () { $(this).droppable({ accept: ".draggable", hoverclass: "append-to-task", over: function (e, ui) { // add class 'accept-incoming-task

c# - How to keep border on a fixed form? -

Image
i want windows forms form keep window border, while having no title bar , being non-resizable (fixed) (similarly window previews, when 1 hovers mouse on button on taskbar): setting controlbox false , text "" removes title bar , keeps border want to, border visible if form sizeable. when set formborderstyle 1 of fixed* styles, border disappears: how may achieve described behavior? you can pinvoke setwindowslong , adjust window styles : // run in linqpad private const int gwl_style = -16; private const int ws_sizebox = 0x040000; [dllimport("user32.dll", setlasterror = true)] private static extern int getwindowlong(intptr hwnd, int nindex); [dllimport("user32.dll")] private static extern int setwindowlong(intptr hwnd, int nindex, int dwnewlong); void main() { var form = new form(); form.controlbox = false; form.formborderstyle = formborderstyle.fixeddialog; form.show(); setwindowlong(form.handle, gwl_style, ge