Posts

Showing posts from July, 2012

c++ - conversion from 'size_t' to 'rapidjson::SizeType' -

i have c++ example code: void test() { rapidjson::document doc; doc.setobject(); const std::string source = "the quick brown fox jumps on lazy dog"; rapidjson::value source_val; source_val.setstring( source.c_str(), source.length(), doc.getallocator() ); } and @ compile time, on x64 platform, warning: warning c4267: 'argument': conversion size_t rapidjson::sizetype , possible loss of data how can correctly convert string's length ( size_t ) rapidjson sizetype? per documentation : rapidjson uses 32-bit array/string indices on 64-bit platforms, instead of using size_t . users may override sizetype defining rapidjson_no_sizetypedefine .

angular - angular2 CLI HTTP not found error -

i've created new angular2 application using angular-cli . trying data api using http . code i've written: movies.service.ts import { injectable } '@angular/core'; import { movie } './movie'; import { http, response } '@angular/http'; import { observable } 'rxjs/observable'; import 'rxjs/rx'; my atom editor gives error on @angular/http line. so, i've manually installed angular2 using npm install angular2 on project folder , modify error generated line this: import { http, response } 'angular2/http'; but console showing: "networkerror: 404 not found - http://localhost:4200/angular2/http/index.js " i've added in index.html page following script: <script src="https://code.angularjs.org/2.0.0-beta.17/http.dev.js"></script> and in package.json files dependencies "angular2": "2.0.0-beta.17", . still same error. anyone have clue? i'm newbie ...

javascript - Cannot protect the color of my svg when using mouseover method -

i have circles created in loop , want change color of these circles red when mouse hovers on them. but when mouse loses focus on these circles, want them protect color had before mouse hovered on them. since circles created loop, not sure how that. the arrays : analyzedunique = [34675791162, 10132910658, 10588895486, 10609894726, 14794759174, 1790587656, 18895624430, 3610288229, 4170058208, 5550074705, 7600064469] [1790587656: "blue", 3610288229: "orange", 4170058208: "blue", 34675091162: "blue", 10132910658: "orange", 10588895486: "orange", 10609894726: "orange", 14794759174: "blue"…] checkcustomer array numbers of people color assigned them stating if customer engineer. for (i = 0; < numberofcirclesshown - 2 ; i++) { var circle = svg.append("circle") .attr("cx", circler + r - r * cosdegrees(alpha * (i+1))) .attr("cy", firstcircley - r * sindegrees(...

javascript - Select documents of a collection depending on user roles -

i need documents of collection has specific value field ( section ) - depends on user role - or userid field user . so i'm trying check if user in role , put query: var sectionone = roles.userisinrole(meteor.userid(), ['something']) ? { section: 'cars' } : undefined; var sectionsecond = roles.userisinrole(meteor.userid(), ['anything']) ? { section: 'vegetables' } : undefined; var sectionthird = roles.userisinrole(meteor.userid(), ['else']) ? { section: 'countries' } : undefined; var count = collection.find( { $or: [ sectionone, sectionsecond, sectionthird, { user: userid }, ], read: { $nin: [ userid ] } } ).count(); console.log(count); what correct way that? for better understanding here example of i'm trying do: example if user has roles something , else , query should this: var count = collection.find( {...

android - First time SharedPreferences use with GridView -

Image
this apps screenshoot : there 2 button in gridview : +/-. so im gonna try when press "+" button or "-" button, quantity store in sharedpreferences. but im confused this. this code far : package com.android.customer_blanjapasar.utility; import android.content.context; import android.content.sharedpreferences; import android.preference.preferencemanager; import android.text.editable; import android.text.textwatcher; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.baseadapter; import android.widget.button; import android.widget.imageview; import android.widget.textview; import com.android.customer_blanjapasar.r; import com.squareup.picasso.picasso; import java.util.arraylist; import java.util.list; /** * created leon on 5/3/2016. */ public class customgridview2 ex...

javascript - How to extract model from backbone collection on the basis of a field which is array of JSON -

i have collection of models in model contains field data, array of json. data [{x : 3, y:4}] now want use where function of backbone collection : var model= coll.where ({ data : data }) it gives no output. not sure whether doing right or missing. please guide me soluiotn if @ how where works: where: function(attrs, first) { if (_.isempty(attrs)) return first ? void 0 : []; return this[first ? 'find' : 'filter'](function(model) { (var key in attrs) { if (attrs[key] !== model.get(key)) return false; } return true; }); } you'll see scanning models , comparing attributes using !== . when using !== or === (or != or == matter) compare arrays, references compared, not content; example, false: [1] === [1] the result searching array using where doesn't work well, where meant shortcut searching simple scalar values. if need search array, can use filter directly , can use _.isequal compare things: var mode...

javascript - ie6 img width:auto doesn't work -

i have image element dynamically changed, , if necessary dynamically re-sized fit container. my current process is: reset image: // make sure 'load' event re-triggered img.src = ""; // reset dimensions img.style.width = "auto"; img.style.height = "auto"; set new source , wait load img.src = newimagesource; in images onload handler, size tested , if necessary, altered: img.style.width = newwidth + "px"; this repeated image changed (infinite). this works fine browsers tested (ie7,8,9,10, ff, chrome) ie6 setting width/height "auto" seems resize element around 25 x 25 px regardless of actual image's dimensions. so; there way reset images dimensions equivalent of "auto" dimensions of image subsequently loaded determines elements dimensions ie6? i believe can write img.style.width = ""; to set width default value of auto . apparently img.style.width = "auto"; doe...

java - CopyOnWriteArrayList iteration inconsistancy with multithreading? -

i'm sending batches of strings in copyonwrite arraylists executorservice processed in parallel, runnable task processing these lists need iterate on list , processing on each string. after running issues concurrency regular arraylists, tried use copyonwritearraylists because they're thread-safe, results inconsistent. is, different results on every run of program, suggesting contents of arraylist changed in way before each runnable taks can iterate on it. public static class batchrunnable implements runnable { private copyonwritearraylist<string> batch; batchrunnable(copyonwritearraylist<string> batch){ this.batch = batch; } @override public void run(){ //iterate on batch , work string elements //make no modifications batch } } the runnable task makes no modifications arraylist, iterates on list , uses string elements of list processing. the place in copyonwritearraylist changed @ instantiation each new r...

android - Getting the blank screen for 2 or 3 seconds while displaying video after image -

i developing 1 android application in able play videos , images in sd card.but getting blank screen 2 or 3 seconds while displaying video after image. don't want blank screen, need show video after image. can tell how that? try playing video inside onprepared() , first of initialize videoview path or uri of video , play it, mvideoview.setvideouri(uri.parse(path)); mvideoview.setonpreparedlistener(new onpreparedlistener() { @override public void onprepared(mediaplayer mp) { mvideoview.start(); } });

Varnish 4 Basic Authentication constantly prompts for username and password -

i'm using varnish 4 on test environment , want protect access content using basic authentication. what want happen first request causes prompt basic auth , no longer asks once user has entered username , password. have setup rule varnish check correct authroization , ask user provide if have not. my end users complaining repeatedly challenged basic authentication details in browser having enter 20 times before first page shown. when using chrome browser, doesn't seem happen unless have dev tools panel open , have not cache requests dev tools panel open ticked. in various versions of ie, happens time. in vcl, basic auth rule looks in sub vcl_recv section: if (!req.http.authorization ~ "basic xxxxxxxxxxxxxxxxxx==" # don't require auth if ip on authpass list. && !client.ip ~ authpass # don't require auth if live website. && !req.http.host == "www.mylivesite.com") { return(synth(401, "authentication...

Printing float with precision 2 but without decimal(.) in C++ -

please consider code snippet shown below: // setprecision example #include <iostream> // std::cout, std::fixed #include <iomanip> // std::setprecision int main () { double f =3.14159; std::cout.precision(2); std::cout << f*100 << '\n'; return 0; } what want print on screen 314 (i.e. print f without decimal precision 2) i want thinking of first setting precision 2 , multiplying 100. but seems precision applied on f*100. can suggest of way apply precision on f multiply number 100 , print precision 0? multiply 100 , print precision 0. int main () { double f =3.14159; std::cout.precision(0); std::cout << std::fixed << f*100 << '\n'; return 0; }

java - Dijkstra's two-stack algorithm for expression evaluation -

i'm reading book on algorithms , data structures , try follow examples. try implement dijkstra's two-stack algorithm expression evaluation. takes input in form of string ( 1 + 2 ) * 3 , evaluates expression. code compiles doesn't produce correct output. the output above expression is: 3.0 here's code: public class eval { public static void main(string[] args) { string s = "( 1 + 2 ) * 3"; evaluateandprintresult(s); } public static void evaluateandprintresult(string s) { string[] str = s.split("\\s+"); queue<string> q = new linkedlist<string>(); for(string ss : str) q.add(ss); stack<string> ops = new stack<string>(); stack<double> vals = new stack<double>(); while (!q.isempty()) { // read token, push if operator. string token = q.poll(); if (token.equals("(")) ; ...

php quotation mark is not working -

i facing problem in php code. basic question don't know answer. code here: echo '<a href="profile.php?act=show&id=<?=$_session['id']?>&line=true" class="myac">my data</a>'; how use quotation mark in id ? please me. that's wrong. using echo . concatenate value way: <?php echo '<a href="profile.php?act=show&id=' . $_session['id'] . '&line=true" class="myac">my data</a>'; //-------------------------------------^^^^^^^^^^ and please refrain using short tags ( <? ?> ), use full tags: <?php ?> .

Hibernate/JPA doesn't work -

this third question far trying fix this. tried lot of things, yet keeps failing , throwing exact same error on , on. let's see if can me time. see, persistence.xml: <?xml version="1.0" encoding="utf-8" standalone="no"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="1.0" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="pruebaswebpu" transaction-type="jta"> <provider>org.hibernate.jpa.hibernatepersistenceprovider</provider> <jta-data-source>java:app/jdbc/nuevaconexion</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <!-- hibernate properties --> ...

cassandra - Query all and consistency -

this question regarding behavior of cassandra select * query. it's more understanding, know normaly should not execute such query. assuming have 4 nodes rf=2. following table (column family): create table test_storage ( id text, created_on timestamp, location int, data text, primary key(id) ); inserted 100 entries table. now select * test_storage via cqlsh. doing query multiple times different results, not entries. when changing consistency local_quorum complete result. why so? assumed, despite performance, consistency 1 entries since must query whole token range. second issue, when add secondary index in case location, , query select * test_storage location=1 random results wiht consistency one. , correct results when changing consistency level local_quorum. here don't understand why happens? when changing consistency local_quorum complete result. why so? welcome eventual consistency world. understand it, read slides: http://www.sl...

sql - Creating indexes on two columns to check if a date falls between those two -

i'm using laravel 5 , postgres. there table has 2 columns 'start_date' , 'end_date'. want create index can check if date falls in between two. i'm using following code that $table->date ( 'start_date' ); $table->index('start_date'); $table->date ( 'end_date' ); $table->index('end_date'); but saw there option create compound index too. my question best way create indexes above scenario? depends on queries are. while other databases mysql can use 1 index per table in situations postgresql can use more one. thus if have 2 separate indexes on start_date , end_date chances both used if close has conditions both columns. note there isn't guarantee both indices or 1 of them might used. example if have few rows faster retrieve data directly without referring index. in situation having composite index wouldn't of use either. if have other queries involve 1 of 2 columns, again better off 2 separ...

javascript - JSTree, Add child node is not working -

i using jstree first time, trying add child node existing node not working far. know topic have been discussed many times tried lot of suggestions , still doesn't work out. here piece of code $('#jstree_div').jstree(); var elemselected=$("#jstree_div").jstree(true).get_selected(true); var position = 'inside'; var childnode = { state: "open", data: "child node" }; $('#jstree_div').jstree("create_node", elemselected, position, newnode, false, false); <div id='jstree_div'> <ul> <li id='racine' data-jstree={'opened':true,'selected':true}> <a id='j2_6_anchor' class='jstree-clicked' href='#'></a> </li> </ul> </div> i don't know missing, greatfull if can me problem var tree = $('#jstree_div').jstree({core:{ check_callback : true }}); you need add...

php - Use function to add choices to select form Symfony 2 -

i'm developping symfony application (v2.8) 2 main bundles : easyadmin , fosuserbundle. i have users particular role , i'm using 'findby' array retrieve users. i override form of admin controller fill select form choices users. know it's possible array want dynamic if add or delete users. i don't know how can call function 1 of controllers (or have declare service ?) add choices select form query. here example of : $formbuilder->add('field_to_override', 'choice', array( 'choices' => **my_function**, 'multiple' => true, 'expanded' => true, )); i hope i'm clear in explanation. thank in advance ! consider using entitytype field , specialized form of choice field uses doctrine entities choices. it possible specify custom query choices too, e.g. $builder->add('users', entitytype::class, array( 'class' => 'appbundle:user', 'query_bu...

How to get all the messages from kafka topic and count them using java? -

this code gives me messages beginning , waiting message , it's waiting message import java.util.hashmap; import java.util.list; import java.util.map; import java.util.properties; import kafka.consumer.consumerconfig; import kafka.consumer.consumeriterator; import kafka.consumer.kafkastream; import kafka.javaapi.consumer.consumerconnector; import kafka.message.messageandmetadata; public class testconsumer{ public static void main(string[] args) { consumerconfig config; properties props = new properties(); props.put("zookeeper.connect","sandbox.hortonworks.com:2181"); props.put("group.id", "group-4"); props.put("zookeeper.session.timeout.ms", "400"); props.put("zookeeper.sync.time.ms", "200"); props.put("auto.commit.interval.ms", "200"); config = new consumerconfig(props); consumerconnector consumer = kafka.consumer.consumer.createjavaconsum...

c - Dynamic memory allocation after scanf -

is possible have dynamic memory allocation in string read scanf without first declaring array? it not possible dynamically allocate memory string after having read scanf , scanf needs pointer. means must allocate memory first, in order give argument scanf . you can following example : char *str; str = malloc(x*sizeof(char)); //where x number of characters want allocate if (str != null) int result = scanf("%s", str); in other words, pass allocated pointer scanf . note : should careful input give, might cause buffer-overflow if give string larger allocated space.

excel - Identify pattern in words -

i have question believe quite simple, don't know proper way it. basically, program able identify words pattern in it, , if so, extract what's before pattern. the pattern be, in case /f , @ end of word, , extract what's before. for example, if program finds 21/f , identify match , extract 21 . if word 21/fudge , wouldn't anything. do know way match @ specific position in word? i do: if str "*/f" before=left(str, len(str)-len("/f")) else 'no match! end if

tsql track all changes related to one table in the database -

i have transactional db, table t1 pk , want track changes occurred in tables related t1. thought of using cdc, able browse existing cdc tables see ones have changes related t1 proved bit of challenge. easy changes tables connected t1 directly, no matter level (e.g. tn has fk tn-1, has fk tn-2 etc has fk t2 has fk t1). don't know how create script changes tables not connected directly, e.g. t6 has fk t5 has fk t4, t3 has fk t4 , t2, , t2 has fk t1 (1st or through multiple levels), t6 connects t1 in end, not through 1 way type of relationship. does have idea on how this? a specific example: have table contracts has column contractid , other columns , want create history table holds changes related contractid, have columns contractid, oldvalue, newvalue. these changes can come a) tables have fk contracts.contractid, example tblperiod(periodid, contractid, etc), b) tables reference contracts.contractid through multiple relationships, e.g. tblsubperiod (subperiodid, periodid, et...

matlab - Excel Range object throws error 0x800A03EC because of a string longer than 255 characters -

using activex server matlab, trying highlight many cells in excel sheet @ once. these not in specific columns or rows use range('a1,b2,...') access them. string accepted range object has less 255 characters or error: error: object returned error code: 0x800a03ec is thrown. following code reproduces error empty excel file. hactx = actxserver('excel.application'); hwb = hactx.workbooks.open('c:\book1.xlsx'); hsheet = hwb.worksheets.item('sheet1'); col = repmat('a', 100, 1); row = num2str((1:100)'); %' cellind = strcat(col, strtrim(cellstr(row))); str1 = strjoin(cellind(1:66), ','); %// 254 characters str2 = strjoin(cellind(1:67), ','); %// 258 characters hsheet.range(str1).interior.color = 255; %// works hsheet.range(str2).interior.color = 255; %// error 0x800a03ec hwb.save; hwb.close(false); hactx.quit; how can around this? found no other relevant method of calling range, or of otherwise getting cell...

javascript - Using AngularJS date filter with UTC date doesn't work with get method -

i have utc date passing angular's date filter convert local time zone after submitting form , still in same page bellow : $scope.xservice.update($scope.id, $scope.model).success(function (data, status, headers, config) { $scope.addalert("success", "opération terminée avec succès"); var mydate1 = data.startdatetimeutc; var mydate2 = data.enddatetimeutc; data.startdatetimeutc = $filter('date')(new date(mydate1), 'dd/mm/yyyy hh:mm'); data.enddatetimeutc = $filter('date')(new date(mydate2), 'dd/mm/yyyy hh:mm'); $scope.model = data; alert($scope.model.publishstartdatetimeutc); alert($scope.model.publishenddatetimeutc); }).error(function (data, status, headers, config) { $scope.addalert("dan...

Excel VBA loop and get value from an array -

i have following code retrieve selection making array of string. dim strargument variant dim irange range dim ricosstring variant set irange = selection ricosstring = rangetostringarray(irange) dim varray variant = lbound(ricosstring) ubound(ricosstring) set varray = ricosstring(i) my problem here on ricosstring(i) . throwing error subscript out of range. ideas why? here code rangetostringarray public function rangetostringarray(therange excel.range) string() dim variantvalues variant variantvalues = therange.value dim stringvalues() string redim stringvalues(1 ubound(variantvalues, 1), 1 ubound(variantvalues, 2)) dim columncounter long, rowcounter long rowcounter = ubound(variantvalues, 1) 1 step -1 columncounter = ubound(variantvalues, 2) 1 step -1 stringvalues(rowcounter, columncounter) = cstr(variantvalues(rowcounter, columncounter)) next columncounter next rowcounter rangetostringarray = stringvalues end function rangetostringarray 2 ...

c# - How to save a file by using serialize xml -

im trying save file datagrid using button dont know how make saving , user can choose save. having problems on code. private void button_click_4(object sender, routedeventargs e) { var path = @"c:\\users\\tiago\\documents\\teste\\save.xml"; if (serializableobject == null) { return; } try { xmldocument xmldocument = new xmldocument(); xmlserializer serializer = new xmlserializer(serializableobject.gettype()); using (memorystream stream = new memorystream()) { serializer.serialize(stream, serializableobject); stream.position = 0; xmldocument.load(stream); xmldocument.save(path); stream.close(); } } catch (exception ex) { } } this got now. if want allow user choose location , na...

android - Table has no column named xyz while inserting data into SQLite database -

Image
it says column name bmi not exist. resulting error message system cannot find column called bmi. checked couple of times , couldn't find mistake in code. maybe guys see one... full stack dump attached after code. public class mydbhandler extends sqliteopenhelper{ private static final int database_version = 1; private static final string database_name = "bmiwerte.db"; public static final string table_bmis = "bmis"; public static final string column_id = "_id"; public static final string column_name = "name"; public static final string column_bmi = "bmi"; public mydbhandler(context context, string name, sqlitedatabase.cursorfactory factory, int version) { super(context, database_name, factory, database_version); } private static final string create_table_bmis = "create table " +table_bmis +" (" +column_id +" integer autoincrement, " +column_name ...

ubuntu 14.04 - GitLab CI: Unable to set JAVA_HOME -

i running git-lab server ubuntu 14 trying compile build on git-lab ci reasons keep getting same error on , on again: error: java_home set invalid directory: /usr/lib/jvm/java-7-openjdk-amd64/jre please set java_home variable in environment match location of java installation. no matter how change path of java_home same results. have 4 folders inside jvm folder: java-8-oracle java-7-openjdk-amd64 java-1.7.0-openjdk-amd64 default-java but again no matter directory set path same result. here .gitlab-ci.yml file: before_script: - export java_home=/usr/lib/jvm/java-7-openjdk-amd64/jre - export android_home="/opt/android-sdk" - chmod +x gradlew dev: script: - ./gradlew assembledebug what cause of error? try change .gitlab-ci.yml this: before_script: - export android_home="/opt/android-sdk" - export java_home="/usr/lib/jvm/java-1.7.0-openjdk-amd64" - chmod +x gradlew dev: script: - ./gradlew assembledebug ...

Rows not showing up in DataTable -

i have datatable in view this: <table id="tblproviders" style="font-size:x-small;width:100%; border: 1px solid black;"> <caption>assigned providers</caption> <thead> <tr> <th>id</th> <th>name</th> <th>email</th> <th>phone</th> <th>role</th> <th>remove</th> </tr> </thead> </table> and assignment of data: $("#tblproviders").datatable({ bprocessing: true, sajaxsource: '@url.action("getprovidersbyid")?id=' + $("#txtid").val(), bjqueryui: true, sprocessing: "<img src='~/images/spinner.gif' />", dom: ...

mysql - More Waiting time in getting data from database table with large data in PHP -

i have 2 tables 'employee' , 'employeeleaves'. want calculate how many days employee have taken leave year. 'employeeleaves' table have leave details last 3 years. im using adodb.inc.php lib files database connectivity. have 50 employees records , 1000 records of leave taken. application takes approximately 1 minute data , displaying. when see in google chrome->developer tools->network, waiting(ttfb) - 38.46s. i want reduce time.because once 'employeeleaves' table more data,then waiting time increase. below paste data fetching coding, first take employee list , each employee im calculating leaves particular year. $employee = new employee(); $employees = $employee->find("1=1"); foreach($employees $employee){ $employeeleave = new employeeleave(); $employeeleaves = $employeeleave->find("employee = ? , leave_period = ? , leave_type = ? , status = ?", array($employeeid,'2016...

javascript - Adding other functions between Jquery calls -

my first post. learning go along project, bare me! below find code program. basically, have jquery calls fades in , out divs. however, before jquery fades out , fades in div, i'd check form validation , user input. my question is, how add other functions in between jquery, have done validateform(); & validatepostalcode(); ? jquery <script type="text/jquery> $(document).ready(function() { $("#welcome").fadein('fast'); $('#forward').click(function(e) { $('#welcome').fadeout('fast', function() { $('#service').fadein('fast'); }); }); $('#previous-service').click(function(e) { $('#service').fadeout('fast', function() { $('#welcome').fadein('fast'); }); }); $('#next-service').click(function(e) { postalcode(); ...

node.js graph api access token extend OAuthException code 101 -

i'm writing social app server using facebook graph api. first steps in graph api have lot of problems that. main problem how extend user short access token. have explored lot of facebook documentation, forums , on cant find documentation node.js , facebook api. ok here questions: 1) how extend user/page access token in node.js server side ? - try sth ( using fbgraph module ) graph.extendaccesstoken({ "access_token": newuser.accesstoken , "client_id": newuser.id , "client_secret": my_app_secret }, function (err, facebookres) { } this code give me oauth error code 101 - wrote in title 2) can tell me can find documentation fb graph api node.js ? documentation means me every function has description, params description , function returns. 3) newest module in node.js fb graph api , can find documentation ? 4) give me basic knowledge creating request fb. mean how should (appsecret , appid co...

java - HTTP Status 404 when deploying the project on Tomcat 8 -

i following this tutorial , want compile spring-ajax project eclipse. the git link of project: able compile , deploy project jetty instance using: mvn:jetty run now need deploy tomcat 8 server. this, follow usual steps worked other projects: eclipse -> run -> maven build, start server, got localhost:8080/appname. added project server. however particular project get: http status 404 - /spring4ajax this pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.mkyong</groupid> <artifactid>spring4-mvc-maven-ajax-example</artifactid> <packaging>war</packaging> <version>1.0-snapshot</version> <name>spring4 mvc maven ajax example</name> ...

javascript - Making compiled typescript code globally accessible -

i've been working on little project recently, , ran issue of having project me accessible in rest of page. here's deal: it's javascript router. doing sake of interest. i've set typescript compiler via grunt , module loading , concatenation via grunt-requirejs. here's grunt file: https://github.com/forestdev/jsroute/blob/master/gruntfile.js the output, however, doesn't seem generate export window. have been googling how export code window or anywhere other javascript files access it. could problem wrapper? need insert custom wrapper of this? what's general rule of thumb of making typescript project global? edit: forgot list index file: https://github.com/forestdev/jsroute/blob/master/src/index.ts ignore line new instance of object. want export object else create new instance of themselves. found way handle exposing global scope. within grunt build requirejs script added custom wrapper, is: wrap: { start: '(function(globa...

javascript - When alternative log in three type user add, update,delete button show and hide, how possible in angularjs? -

i want alternative log in 3 type's user add, update, delete button show , hide, how possible in angularjs? i'm trying make system simple possible. html code: <div ng-show = "isoperator" class="panel-body"> <input ng-model="isoperator"> </div> <div ng-show = "isadmin" class="panel-body"> <input ng-model="isadmin"> </div> <div ng-show = "issuper" class="panel-body"> <input ng-model="issuper"> </div> javascript code: .controller("configctrl" , ["$scope","$rootscope","$location","$http", function($scope,$rootscope,$location, $http){ var operator = $scope.isoperator; $scope.addconfigbtn=true; $scope.addvpnconfigbtn=true; $scope.canconfigbtn=true; $scope.saveconfigbtn=true; ...

c# 4.0 - Active Directory throwing Exception, on hosting the application in IIS but working fine from Visual Studio. Please suggest how to resolve this? -

i developing intranet web-application. requirement build application using single sign on(sso). implemented windows authentication & fetching user details active directory passing user domain & userid of user received after windows authentication. getting userid & domain after windows authentication void session_start(object sender, eventargs e) { logger logger = new logger(); logger.logmessage("creating session user- "; + user.identity.name); sessionmanager.createusersession(user.identity.name); } in create user session method below calling getuserdetails method in authentication manager class public class sessionmanager { public static void createusersession(string clientwindowsid) { logger logger = new logger(); userprofile user = new userprofile(); authenticationservice authenticationmanager = new authenticationservice(); string userid = clientwindowsid.contains("\\...

No heading Javascript JSON Array -> CSV Export -

hi guys export works dont have heading :/ i dont know problem information: i'm getting data database it's json array can me? my code: var csvcontent = "data:text/csv;charset=utf-8,"; $("#csv").click(function(){ // iterating through objects data.foreach(function (infoarray, index) { // fetching keys of single object var _keys = object.keys(infoarray); var datastring = []; //test heading // var heading = ["timestamp ; toolversion ; monitortype ; serialnumber; monitorrevision ; testscript ; testcase ;testcaseversion ;testscope; duration; result; clickcount ;morbalwaitaverage; morbalwaitmin ; morbalwaitmax ; timingproblems ; abortedretries ; operationretries ; acknowledgeaverage ; increasedupdatetime ; falsescrolls "]; //datastring.push(heading); if(index==0){ [].foreach.call(_keys, function(inst, i){ datastring.push(inst); }...