Posts

Showing posts from April, 2013

c++ - Schwarz Counter for a vector -

i looking @ case have global static std::vector need guarantee initialized (constructed) before static objects in assortment of translation units. when how handle come across 2 proposed solutions: have static object in global function used in place of global static object. schwarz counters my concern using schwarz counter std::vector initialized twice. this link "a useful technique ensuring global object initialized once , before first use maintain count of number of translation units using it." how work global initialized once? reasoning initialized twice. once in normal course of static initialization , once when first instance of schwarz counter initialized. on related note, initialization code in schwarz counter constructor? can think of using placement new. i can how i've implemented in past: design special "no-op" constructor, nothing, , use placement new in schwartz counter. like: class foruseasstatic { public: enum m

php - Insertion into database -

how query insert row 1 table another? use conventional insert select delete . thing works deleting trade. values not updating in new table. used constants in second table because tables have unmatched columns , problem here? <?php //if(!isset($trade_id)){ $trade_id= $_get['id']; //} require_once('connect.php'); $mysqli = new mysqli($database_hostname, $database_username, $database_password, $database_name) or exit("error connecting database"); try { // first of all, let's begin transaction $mysqli->autocommit(false); // set of queries; if 1 fails, exception should thrown $mysqli->query("insert `trade_history1` (session_id, trade_id, selection, date, type, size, bidprice, offerprice, stoploss, takeprofit,dateclose,close, profitandloss) select session_id, trade_id, selection, date, type, size, bidprice, offerprice, stoploss, takeprofit, profitandloss,'null','null' `opentrades` `trade

vba - vb6 screen capture GdipSaveImageToFile similar function for byte array -

in visual basic 6, have following code tackes screen capture , encode or converts jpg, in file. (eg. lres = gdipsaveimagetofile saves jpg file dont want save file instead jpg should saved in memory or in byte array) i want save jpg image in memory or byte array. should do. i dont want save png in memory encoded jpg in memory, have search lot till not found solution. public sub desktoptojpg(byval filename string, optional byval quality long = 80, optional includemousecursor boolean = false) on error resume next dim tsi gdiplusstartupinput dim lres long, lgdip long, lbitmap long dim x long, y long, wide long, high long dim mydib long, mydc long, desktopdc long dim bi24bitinfo bitmapinfo dim bitmapdata() byte dim pcin pcursorinfo dim piinfo iconinfo ' starting position/size of capture (full screen) x = 0: y = 0 wide = screen.width / screen.twipsperpixelx high = screen.height / screen.twipsperpixely ' bi24bitinfo.

java - AspectJ: ClassLoading issue when trying to use external aop.xml file -

i m trying externalize configuration of aop.xml removed aop.xml meta-inf , made available in server manual configuration sys admins. when try use external aop.xml using -dorg.aspectj.weaver.loadtime.configuration="file:d:\workspace\tomcat7\shared\lib\aop.xml" i java.lang.runtimeexception: cannot register non aspect: aspectclass.... because aj casses not loaded appclassloader yet @ time. , next time tries register aspects webappclassloader ( after classes loaded), works fine, still exceptions logged 1st attempt register it. the exception caught , logged @ classloaderweavingadaptor.java line 307. when following line called: success = registeraspects(weaver, loader, definitions); the exception caught , logged. try { registeroptions(weaver, loader, definitions); registeraspectexclude(weaver, loader, definitions); registeraspectinclude(weaver, loader, definitions); success = registeraspects(weaver, loader,

ios - In Xcode Interface Builder - why are the options in the Editor--->Arrange menu (containing Send to Front, Send to Back) often disabled? -

what i'm trying simple: bring label in front of image within subview. but of options arranging disabled/un-selectable when label selected. find happens often. what reason i'm never allowed change z-axis of objects in arrange menu? better practice avoid feature , set order of views programmatically? it can depend on how have selected label (similar how label can moved keyboard when selected in ways). a simple alternative @ list of view in pane on left , drag views , down change order.

Canny Edge Image - Noise removal -

Image
i have canny edge detected image of ball (see link below) contains lot of noisy edges. best image processing techniques can use remove these noisy edges without removing edges belonging ball? original image canny edge image many in advance , advice, appreciated! ps trying clean edge image prior using circle hough transform detect ball. the best option filter image before applying edge detector. in order keep sharp edges need use more sophisticated filter gaussian blur. two easy options bilateral filter or guided filter . these 2 filters easy implement , provide results in cases: gaussian noise removal preserving edges. if need more powerful, can try filter bm3d , 1 of state-of-the-art filters, , can find open source implementation here .

html - I'm trying to change my link color in jQuery. Why is it not working -

here have far: $('a').hover(function(){ ('this').css('color','#f60') }); }); my intention have users hover on link have color change white orange $('a').hover(function(){ $(this).css('color','#f60') }); }); reference: http://remysharp.com/2007/04/12/jquerys-this-demystified/

android - Adding button in preferencescreen added in xml folder -

this question has answer here: how add button preferencescreen 9 answers i have created preference screen below data, want add button, how can add button in preference screen. tried using button directly in code gave exception. please me out this. <preferencecategory android:title="all numbers"> <switchpreference android:key="switch_key" android:defaultvalue="false" android:disabledependentsstate="true" android:title="block calls:"/> </preferencecategory> <preferencecategory android:title="individual numbers"> <switchpreference android:key="individual_number" android:defaultvalue="false" android:dependency="switch_key"

Why a calling function in python contains variable equal to value? -

i have started learn python, , ask considered little magic in language. i note before learning python worked php , there haven't noticed that. what's going on - have noticed call constructors or methods in python in form. object.call(variable1 = value1, variable2 = value2) for example, in flask: app.run(debug=true, threaded=true) is reason convention? or there semantical reason outgoing language fundamentals? haven't seen in php in python , because i'm surprised. i'm curious if there magic or it's convention read code easier. these called keyword arguments , , they're used make call more readable. they can used pass arguments in different order declared parameters, or skip on default parameters pass arguments others, or because function requires keyword arguments… but readability core reason existence. consider this: app.run(true, false) do have idea 2 arguments mean? if can guess 2 reasonable arguments threading , debugging

vector - GLSL - Vertex normals + normal mapping? -

i'm trying create simple shader lighting system. right now, i'm working on adding support normal-mapping right now. without normal-mapping, lighting system works fine. i'm using normals forwarded vertex shader, , work fine. i'm reading normals normal map correctly. without including normal map, lighting works perfectly. i've tried adding vertex normal , normal map's normal, , doesn't work. tried multiplying. here's how i'm reading normal-map: vec4 normalheight = texture2d(m_normalmap, texcoord); vec3 normals = normalize((normalheight.xyz * vec3(2.0) - vec3(1.0))); so have correct vertex normals, , normals normal map. how should combine these correct normals? it depends on how store normal maps. if in world space begin (this rather rare) , scene never changes, can them way have them. typically, however, in tangent space. tangent space vector space uses object's normal, , rate of change in (s,t) texture coordinates transform normal

objective c - Change NSURLConnection from sendSynchronousRequest to sendAsynchronousRequest? -

my code nsurlconnection sendsynchronousrequest works fine how can change async request? tried lot nothing work. if request empty i´ll empty array [[]] . how can catch alert message? please ... [uiapplication sharedapplication].networkactivityindicatorvisible = yes; nsstring *urlstring = @"http://www.xyz.at/sample.php"; nsurl *url = [nsurl urlwithstring:urlstring]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:url]; [request sethttpmethod:@"post"]; nsmutabledata *body = [nsmutabledata data]; nsstring *postwerte = [nsstring stringwithformat:@"id=%@", self.textfeld.text]; [body appenddata:[postwerte datausingencoding:nsutf8stringencoding]]; [request sethttpbody:body]; nserror *error = nil; nsdata *returndata = [nsurlconnection sendsynchronousrequest:request returningresponse:nil error:&error]; nslog(@"error: %@", error.description); n

jquery - Why does IE flag telerik.common.min.js as faulty, should I care, and if so, what should I do about it? -

running asp.net app in ie, fails on line in telerik.common.min.js: var aa=parseint(a.browser.version.substring(0,5).replace(".","")) saying, " script5007: unable property 'version' of undefined or null reference telerik.common.min.js " chrome took no such issues telerik js file. a similar error takes place line: b.scripts.push("telerik.menu.js") as ie says, " script5007: unable property 'scripts' of undefined or null reference " is telerik's js code bad in these instances, or ie being overly wary? iow: should ignore these err msgs , click through them, or...???

caching - Stop zend page cache in the Action -

here problem... this in bootstrap: $cache = zend_cache::factory('page','file',$frontendoptions,$backendoptions); $cache->start(); zend_registry::set("cache", $cache); i need cancel $cache->start() action. i've tried zend_registry::get('cache')->cancel() doesn't work (actually, it's expected, because caching starts long before action processing). how can stop caching action? to understand why need it: in action, have function call model, , if return void, make redirect, page shouldn't cached. according zf manual ( the specific cancel method ) quite possible. because of design issues, in cases (for example when using non http 200 return codes), need cancel current cache process. introduce particular frontend, cancel() method. and code seems correct except typo cacnel() instead of cancel()

python - Cumsum reset at NaN -

if have pandas.core.series.series named ts of either 1's or nan's this: 3382 nan 3381 nan ... 3369 nan 3368 nan ... 15 1 10 nan 11 1 12 1 13 1 9 nan 8 nan 7 nan 6 nan 3 nan 4 1 5 1 2 nan 1 nan 0 nan i calculate cumsum of serie should reset (set zero) @ location of nans below: 3382 0 3381 0 ... 3369 0 3368 0 ... 15 1 10 0 11 1 12 2 13 3 9 0 8 0 7 0 6 0 3 0 4 1 5 2 2 0 1 0 0 0 ideally have vectorized solution ! i ever see similar question matlab : matlab cumsum reset @ nan? but don't know how translate line d = diff([0 c(n)]); a simple numpy translation of matlab code this: import numpy np v = np.array([1., 1., 1., np.nan, 1., 1., 1., 1., np.nan, 1.]) n = np.isnan(v) = ~n c = np.cumsum(a) d = np.diff(np.concatenate(([0.], c[n]))) v[n] = -d np.cumsum(v) executing code returns result array([ 1., 2., 3., 0.

reflection - How can I read attributes of a class in an external dll file in c#? -

i have following block of code. how can attribute names specific dll file? currently, can class names, namespace not know how attributes in class. thank you, foreach (type type in myassambly.gettypes()) { propertyinfo mypi = type.getproperty("defaultmodifiers"); system.reflection.propertyattributes mypa = mypi.attributes; messagebox.show(mypa.tostring()); } it sounds you're interested in properties: foreach (type type in myassembly.gettypes()) { foreach (propertyinfo property in type.getproperties()) { messagebox.show(property.name + " - " + property.propertytype); } } edit: okay, sounds really really want fields: foreach (type type in myassembly.gettypes()) { foreach (fieldinfo field in type.getfields(bindingflags.instance | bindingflags.static | bindingflags.public |

c# - XDocument automatically indents files on parse and does not remove indent on save -

Image
i seeking regarding file saving of xml file using xdocument (not xmldocument). so have xml file not have indentation (in fact 1 line). when read xdocument using xdocument.parse (after reading , storing string using streamreader ), resulting xdocument indented. alright, thought fine long if can save file without indentation. however, though have xmlwritersettings writersettings = new xmlwritersettings(); writersettings.newlineonattributes = false; writersettings.newlinehandling = newlinehandling.none; writersettings.indent = false; and pass in when create xmlwriter using (var writer = xmlwriter.create(u.tofilesystempath(), settings)) { xd.save(writer); } the resulting xml file still has indentation. when debugging on visual studio, noticed writer class xmlwellformedwriter . have result? appreciated. thank you. saveoptions available on save() tostring() . string xmlstring = @"<top> <first>1</first> <second>dude&

d3.js - How to wait on d3.json to finish? -

how can wait d3.json fill array saved_data before function callback executed? i'm using saved_data if not empty. otherwise i'm requesting new data , saving in saved_data variable: if (saved_data.length > 0) { callback(null, parse(variable, saved_data)); } else { // -------------- begin request new data ------------------ d3.json(" ... ", function(data) { if (!data) return callback(new error("unable load data")); saved_data = data; }); // how wait on d3.json? before call back? callback(null, parse(variable, saved_data)); } if (saved_data.length > 0) { callback(null, parse(variable, saved_data)); } else { // -------------- begin request new data ------------------ d3.json(" ... ", function(data) { if (!data) return callback(new error("unable load data")); saved_data = data; // put here. callback(null, parse(variable, saved_d

php - .htaccess deny from all, redirect to 404 page and except for 2 files -

how setup .htaccess denys .php file access in include/ folder, , redirect user error page in public_html/ (root) directory when 403, 404 , 500 occurs, except 2 files called index.php , key.php ? currently have: <files "^*\.php$"> order allow,deny deny </files> errordocument 403 /error.html errordocument 404 /error.html errordocument 500 /error.html <filesmatch "^(index|key)\.php$"> allow </filesmatch> but not work properly, <filesmatch "^(index|key)\.php$"> works fine. thanks! you should place .htaccess file include/ directory, if it's not case. think used filesmatch syntax files tag. <filesmatch "^.*\.php$> order deny,allow # deny here, allow later. deny </files> <filesmatch "^(index|key)\.php$"> allow # allow here. </files> then, in root ( public_html/ ), can use : errordocument 403 /error.html # try ../error.html if put line in in

jquery - Bootstrap 3.0.0 breaks the datepicker icon -

here demo if use 2.3.1, uncomment line 12 , see button appearing correctly does know how can fix version 3.0.0-rc1? upadte the answer below true bootstrap 3 release candidates, stable version include glyphicons library requires base class , individual icon class, ex: <span class="glyphicon glyphicon-calendar"></span> original answer: from docs: with launch of bootstrap 3, icons have been moved separate repository . keeps primary project lean possible, makes easier folks swap icon libraries, , makes glyphicons icon fonts more readily available more people outside bootstrap. that means need include glyphicons separately, can use bootstrap's own icons or library font awesome

database - Coldfusion: Is there a way to add a break in the middle of a table? For instance, for the user to add a comment? -

Image
i have basic sales quote website setup--the salesperson selects part number, sets quantity, , part @ appropriate quantity , price added table until user indicates done adding parts. so instance on quote generated, there table 5 columns, headings part #, description, qty, list price, , final price respectively. page, salesman looks or enters part info , click "add part" , each part added in consecutive rows table go automatically. view full image what want sort parts/group them based on category. able add category heading table add parts. if these parts belong "red category" want able add line before parts can type in "red category", keep adding parts normal, , when new category repeat same. view full image the problem i'm having have 1 table, , part add table appears fields need filled in. first thought have them add part had description field filled in, not working. think because each part added has percentage of price automatically

Rails Mobile API -

i have existing rails project uses omniauth-facebook gem connect gem. facebook users can interact , use website. developing mobile application, , want build api current rails project. which gem should use build api? should use 2 different rails projects, 1 website , 1 api? thank you. rails api ready, here quick example lets imagine want show products of app in mobile app lets go products controller: controller: def index @products = product.all respond_to |format| format.js format.html format.json { render json: @products } end end as can see can render json within controller, in mobile app can request on json extension this: $.post('www.example.com/products.json', function(data) { alert(data); }); now adapt mobile app read json, , thats basicly how works

javascript - Video Blocked in Chrome - Ran Insecure content from Video Provider -

i trying embed video url:- http://www.mckinsey.com/videos/video?vid=2548877464001&plyrid=2399849255001&height=270&width=480 it's public video , embed code gives me following:- <object id="flashobj" width="480" height="270" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"><param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9?isvid=1&isui=1" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="videoid=2548877464001&linkbaseurl=http%3a%2f%2fwww.mckinsey.com%2fvideos%2fvideo%3fvid%3d2548877464001%26plyrid%3d2399849255001%26height%3d270%26width%3d480&playerid=1971702156001&playerkey=aq~~,aaabywrpjyk~,mp34hwwotrps3ylijkkinm_zsifwivnw&domain=embed&dynamicstreaming=true" /

Spring thymeleaf th:each fails with Field or property "" cannot be found on null -

i new thymeleaf, have few other pages working. however, first time using th:each , getting error. @ runtime, "field or property 'licensename' cannot found on null". ran debug , passing arraylist of objects in modelanview object. have copied , pasted on model key th:each attribute, in case mist typed something. here offending code: <select th:remove="all-but-first" id="accountplans"> <option th:each="license : ${availablelicenses}" th:text="${licnese.licensename}" value="none">-- select plan --</option> <option value="free">free - plan learn basics</option> <option value="intro">intro - starter plan small founding group</option> <option value="basic">basic - plan small group</option> </sele

mongodb - Is this a valid mongo command format? db.[database].[collection].find() -

i use mongohub of queries. noticed generates mongo command when fill out search criteria. for example, generate this: db.mydatabase.mycollection.find().sort({ "_id": 1}).skip(0).limit(30) when type db.mydatabase.mycollection.find() mongo shell command, nothing returned. (no error message generated either). if instead type: { use mydatabase db.mycollection.find() } then results back. anyone know how mongo interprets db.[???].[????].find() ? db.[???].[????].find() actually creates sub collection using notation, example: > db.gt.gf.insert({g:1}) > show collections gt.gf system.indexes so though valid might not looking for.

file upload - Knockout pass filename to server -

i'm writing application using knockout. want user browse file , want pass filename server. however, due browser security issues, path of file c:\fakepath. does 1 way filename server can file , upload it? reason want use server upload file because i'm storing file using amazon s3 , want server connection. here's binding: <input type="file" name="talkfile" data-bind="value: $root.talkfile"> knockout doesn't have file binding. either submit file old fashioned way or jquery file upload ajax files. if opt. use ajax in template, make sure form wrapping file element multipart encoding (enctype="multipart/form-data") , can add custom binding. i use this: template <input type="file" id="fileupload" name="image" data-bind="fileupload : '.dropzone' " > custom binding ko.bindinghandlers.fileupload = { init: function(el, valueaccessor, aba, mod){

jquery - Unfocus element without blur event being triggered or prevent focus all together -

i have couple of input elements behaving drop down elements in similar manner jquery date event ui works. needs stay way because of nature of application. i've set elements non-editable. allow app build pseudo dropdown menu under list of options while preventing user manipulating directly. once 1 clicked, jquery plugin assigns value input. the issue there validation checker triggered onblur looks validator prematurely validating, of course it's working fine. hate rewrite validator plugin. is there way prevent focus or blur event happening in particular click event? here's js fiddle challenge http://jsfiddle.net/powerphillg5/yhgkq/ and here's code that's there because have have code on here when providing link #law-abidingcitizen: <input type="text" id="my_input" value="click me." /> <script> $('#my_input').blur(function(){ alert("prevent me without removing blur() , function caused me!"

Type Mismatch Error when matching excel user profile to list of names in cells -

i getting error of type mismatch when code runs usernames = .range("a1:a100") . not sure how can fixed, suggestions? sub addpix() dim usernames() string dim userpixnames() string dim currentuser string dim mypassword string mypassword = "trade2013" sheets("collection slip").unprotect password:=mypassword worksheets("user management") 'assign user names array (much faster looping through range) usernames = .range("a1:a100") userpixnames = .range("b1:b100") end = 1 100 'the 1 in usernames(i,1) needed because of way 'vba creates array assigned directly range '(as did above) if environ$("username") = usernames(i, 1) 'have missed picture inserted? sheets("collection slip").pictures.insert _ ("g:\its\shared\signature\" & userpixnames(i, 1) & ".jpg") .top = range("b31").top

java - REST HttpURLConnection -

i working on rest client experimenting tinkerpop database using using httpurlconnection . i trying send on 'get - connect' . understand (from net research) if use dooutput(true) 'client' 'post' if setrequestmethod 'get' post default (well ok?) when comment out the dooutput(true) error: java.net.protocolexception: cannot write urlconnection if dooutput=false - call setdooutput(true) @ sun.net.www.protocol.http.httpurlconnection.getoutputstream(httpurlconnection.java:995) @ restcontent.handlegetconnect(restcontent.java:88) @ restclient.main(restclient.java:42)` here communication code snip have tried various option setusedooutput() . //connection.setdoinput(true); connection.setusecaches (false); connection.setdooutput(true); connection.setallowuserinteraction(false); // set method try { connection.setrequestmethod("get"); } catch (protocolexception e1) { e1.printstacktrace(); connection.disconnect(); } exception

Changing Javascript Counter From Seconds To Milliseconds -

so fiddling around code found week ago due ability 'somewhat' accomplish of old gmail file counter did. i've failed make counter accurately increase @ faster speed other per seconds. by editing lowest 1000 [found @ settimeout(function(){thisobj.start()}, 1000) ] in code counter counts faster when refreshed reverts near started additional second or 2 (depending on time start refresh). <html> <head> <script type="text/javascript"> function countup(startingdate, base) { this.currenttime = new date(); this.startingdate = new date(startingdate); this.base = base; this.start(); } countup.prototype.oncountup = function(){}; countup.prototype.start = function() { var thisobj = this, timediff = (this.currenttime-this.startingdate) / 1000, secondfield = math.floor((timediff)); result = { seco

lucene - Is it possible to left join nested documents in ElasticSearch queries? -

context assume have set of documents have defined nested mapping . assume documents have nested documents , not: document 1 { "id":1, "nested":[ { "x":1 } ] } document 2 { "id":2, "nested":[ { "x":2 } ] } document 3 { "id":3 } problem is there way perform equivalent of following sql query: select r.id, count(*) root r left join nested n on parent(n) = r n.x = 1 /* nested condition */ group r.id something comes close using elasticsearch's query dsl is: curl -xget http://localhost:9200/nested/type/_search?pretty -d' { "fields":["id"], "query":{ "nested":{ "query":{ "constant_score":{ "query":{ "term":{"x":1} } },

linux - Something wrong when I compile and install vim7.4 -

when compile , install vim 7.4,i have error. steps follows: ./configure --prefix=/home/user/.opt/vim74 --with-features=huge --enable-netbeans --enable-multibyte make make install when excute command 'make',i got following error information. make[1]: execvp: echo: permission denied make[1]: [auto/pathdef.c] error 127 (ignored) ...... make[2]: leaving directory `/home/user/src/vim74/src/po' make[2]: entering directory `/home/user/src/vim74/src/po' make[2]: nothing done `converted'. make[2]: leaving directory `/home/user/src/vim74/src/po' make[1]: leaving directory `/home/user/src/vim74/src' and command 'make install' gave me following errors. ...... installing /home/user/.opt/vim74/share/man/man1/vim.1 installing /home/user/.opt/vim74/share/man/man1/vimtutor.1 installing /home/user/.opt/vim74/share/man/man1/vimdiff.1 installing /home/user/.opt/vim74/share/man/man1/ev

javascript - Backbone.JS Error: "Uncaught ReferenceError: homePage is not defined" -

i learning how program in backbone.js , keep on running follow error: uncaught referenceerror: homepage not defined uncaught referenceerror: homepage not defined app.js:30 backbone.router.extend.displayhome app.js:30 (anonymous function) backbone-min.js:1 (anonymous function) backbone-min.js:1 j.some.j.any underscore-min.js:5 h.extend.loadurl backbone-min.js:1 h.extend.checkurl backbone-min.js:1 x.event.dispatch jquery-1.10.2.min.js:5 v.handle i using node.js power server, handlebars template, jquery, , others see in html. error seems coming initialize function in app.js file. if uncomment //var homepage = new homepage({name: 'j***, address: 'jc'}); it renders perfectly. it may small error may have overseen or in libraries self. i'm still new this. appreciated. the following: html code: <!doctype html> <html lang="en"> <head> <title>testing pages || jayvee protype</title>

graphics - Android JB skia api/operation list -

i noticed following explanation in android developer official website, " anticipate skia phased out without adverse effects developers. skia deprecated , in maintenance mode neccessary while because apps published today still rely on non-hardware accelerated canvas operations. in addition, not skia operations supported opengl, operations still done in software skia, hardware acceleration turned on. " will list available tell me operations still being used in android jb graphic part via skia? i sure reference useful me. thanks in advance. the answer available in chart on hardware acceleration page on android developer site. for more background can watch google io session on hardware rendering: http://www.google.com/events/io/2011/sessions/accelerated-android-rendering.html

caching - Cache issue with javascript -

i have javascript code detect fields changes on page. working ie unfortunately not in chrome. don't know why happening. when try access via different browsers , units. javascript not working well. need clear cache history make work properly. here's code: var ctr = 1; var isfirstload = true; function propertychangedbycode() { ctr = 0; propertychanged(); } function propertychanged() { if (document.readystate == "complete") { $('[id$=savebutton]').removeattr("disabled"); $('[id$=savebutton]').removeattr("class"); $('[id$=savebutton]').addclass("btn btn-primary"); warnmessage = 'warning: have unsaved changes.'; console.log(ctr); window.onbeforeunload = function () { if (ctr == 0) { return warnmessage } else if (ctr == 1) {

Bulk Insert Multiple Semicolon Delimited Files into SQL Server -

i have 400 csv files semicolon delimiter. example: column headers (all in 1 field in excel): cust_name;transdate;transnum;unit_price;qty;style_number;country sample data in excel file (all in 1 column): bar clayn;2012-01-01 00:00:00.0;45724;-109.98;-1;803702;ca eal an;2012-01-01 00:00:00.0;48772;-69.98;-1;837642;ca i have referenced post importing multiple csv files sql: stackflow as semicolon delimited file, have created format file bulk insert. the file looks this: 10.0 7 1 sqlchar 2 500 ";" 1 cust_name latin1_general_ci_as 2 sqldatetime 1 8 ";" 11 transdate "" 3 sqlchar 2 500 ";" 12 transnum latin1_general_ci_as 4 sqldecimal 1 19 ";" 19 unit_price "" 5 sqlint 1 4 ";" 20 qty "" 6 sqlbigint 1 8 ";" 22 style_number "" 7 sqlchar 2 500 ";&