Posts

Showing posts from February, 2012

java - How do I get @JsonIgnore to work so that JSON are not returned recursively? -

i have following java class. @component @jsonignoreproperties({"begin", "end"}) public class event extends resourcesupport { @jsonproperty("name") private final string name; @jsonproperty("description") private final string description; @jsonproperty("timezone") private final zoneid timezone; private final localdatetime begin; private final localdatetime end; this gets returned in rest service. regardless of returns deep object representation of localdatetime , below. ... {"hour":1,"minute":0,"second":0,"nano":0},"midnightendofday":false},{"month":"october","timedefinition":"utc","standardoffset":{"totalseconds":3600,"id":"+01:00","rules":{"fixedoffset":true,"transitions":[],"transitionrules":[]}},"offsetbefore"

python - Django Admin looking for field that does not exist -

i using django 1.8, python3, sqlite. i had model foreign key referenced model. updated model remove foreign key , replaced many-to-many key referenced different table. ran makemigrations , ran actual migration without errors. however, when go admin , try add row table following error: exception type: fielderror exception value: unknown field(s) (theoneideleted) specified tableichanged. check fields/fieldsets/exclude attributes of class tableichangedadmin. why there still reference deleted field after migration? more importantly, how can fix it? it looks have updated models.py, haven't updated model admin in admin.py.

xcode - Duplicate XPC service breaks Developer ID application for Gatekeeper -

i'm working on distributing mac application outside of mac app store using developer id signing. things have been working previously, in our last build, has apparently changed causing gatekeeper reject application when opened after download our servers. we're using production "developer id application" certificate. far i've can tell we've followed instructions in distributing applications outside mac app store letter. the confusing part following commands recommended testing gatekeeper conformance execute fine , indicate nothing wrong. validation in xcode organizer passes without complaint. $ spctl -a -t exec -vv myapp.app/ myapp.app/: accepted source=developer id origin=developer id application: company name (248c748vf9) $ codesign --verify --deep --verbose myapp.app/ myapp.app/: valid on disk myapp.app/: satisfies designated requirement $ /volumes/signature\ check/check-signature myapp.app/ (c) 2014 apple inc. rights reserved. yes one thing

javascript - How to catch array sent by PHP script as Ajax response and use further? -

i working on e-commerce project practice , right building product filters. have 3 files catalogue.php it shows products. product filters on left , displays products on right. when user checks box ajax call made. productsfilter.js it contains javascript , ajax calls. var themearray = new array(); $('input[name="tcheck"]:checked').each(function(){ themearray.push($(this).val()); }); if(themearray=='') $('.spanbrandcls').css('visibility','hidden'); var theme_checklist = "&tcheck="+themearray; var main_string = theme_checklist; main_string = main_string.substring(1, main_string.length) $.ajax({ type: "post", url: "mod/product_filter.php", data: main_string, cache: false, success: function(html){ replyval = json.parse(myajax.responsetext); alert(replyval); } }); product_filter.php it php script called ajax call. $tcheck = $objfo

nginx : access.log and error.log file empty -

i have installed nginx on ubuntu 14.04 using command sudo apt-get install nginx now, when open browser , type in address localhost correctly shown "welcome nginx" page. also, checked config file located in /etc/nginx/nginx.conf , found following log settings: access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; however, when check these 2 files, both empty. have opened localhost page multiple times still log files empty. might wrong setup ? i had same issue after reinstalling nginx newer version. seems log files ownership changed , new nginx couldn't save there. removing log files , reloading nginx worked me: $ sudo rm -f /var/log/nginx/* $ sudo nginx -s reload

string - C++: cannot initialize a variable of type 'char**' with a rvalue of type 'char*[x]' -

this question has answer here: address of array 4 answers char str_arr[] = "ads"; char *str_ptr = str_arr; char **ptr_str_ptr = &str_ptr; // ok char **ptr_str_arr = &str_arr; // compile error: cannot initialize variable of type 'char**' rvalue of type 'char*[4]' i'm confused why cannot address of str_arr . ideas? you can address of str_arr . however, address of array, not address of pointer. essentially, assignment fails because types not compatible. here 1 illustration of why cannot assign pointer pointer char , because possible: char **ptr_str_arr = &str_arr; // imagine has worked *ptr_str_arr = new char[10]; // cannot done array this not work const pointers, either, because of type incompatibility. char* const* ptr_const_str_arr = &str_arr; // not work either demo.

Environment variabels unaccessible from rails -

i building rails application have initial configuration files use environment variables, , i'm using cloud9 ide. setting environment variables using export , yet when server running rails tells me parameter value supposed 1 of environment variables missing, , when used debugger, env["var_name"] returns nothing. ideas why? when run echo $var_name in bash, returns correct value. edit: when run console --sandbox , environment variables available. in controller not available. i fixed adding export var_name=var_value in .bashrc .

javascript - Populate a pie chart dynamicaly with a range bar -

i need populate pie chart dynamicaly php script have. my concept have range bar updates series according values contained each index in json. found pie graph looks that: http://codepen.io/kenfalcon/pen/ovkozb . however think not implemented json. i have example, 1 accepts 2 values default (value 1 , value 2). here http://codepen.io/jaybaz1/pen/blgfh $.getjson('https://s3-us-west-2.amazonaws.com/s.cdpn.io/132755/gettabledata.json', function(data, response){ var jsonrowdata = data.responsedata[0].rowdata; $.each(jsonrowdata, function(i){ var $this = $(this); //save each column value seperate array commonality.arrays.complete_data.push([$this[1], $this[2]]); commonality.arrays.commonality.push(parsefloat($this[0])); var = parseint($this[1]), to2 = to.tofixed(2), = parseint($this[2]), from2 = from.tofixed(2); commonality.arrays.coverageto.push(to); commonality.arrays.coveragefrom.push(from); //set default array values commonality.value

jsf 2 - update component in another xhtml form from Custom layout p:selectOneRadio not working -

my xhtml split in menu area (defaultmenu.xhtml) , content area (defaultcontent.xhtml). the code defaultmenu.xhtml is: <h:form id="defaultmenuform"> <p:outputpanel id="menupanel" class="contain auto-fixed-center"> <p:panel id="pmenu" visible="#{phcontroller.user.menuvisible}"> <table id="stutable"> <tr> <td width="15%"> <p:outputlabel id="stuname" value="#{phcontroller.phbean.studentname}" /> </td> <td> <p:tabmenu activeindex="#{param.selectedtab}"> <p:menuitem value="home" outcome="phome" icon="ui-icon-star"> <f:param name="selectedtab" value="0" /> </p:menuitem> <p:

redirect - Redirection after domain extension -

i know how use subdomains re-direct, wondering if possible place redirection after extension. since not wording correctly, mean: i like: website1.com/test to re-direct to: test.com/something is possible this? thank you!

jpa - Entity Update throws NPE for @ElementColection of Map -

i have department , employee entities. employee table has 3 columns: department_id key value inserted null value in insert non null key in employee table. received nullpointerexception during update non null value existing key during prop.put(key, value) : java.lang.nullpointerexception @ java.util.hashtable.put(hashtable.java:514) @ org.eclipse.persistence.indirection.indirectmap.put(indirectmap.java:543) @ org.eclipse.persistence.internal.queries.mapcontainerpolicy.addinto(mapcontainerpolicy.java:131) @ org.eclipse.persistence.internal.queries.mappedkeymapcontainerpolicy.addinto(mappedkeymapcontainerpolicy.java:196) @ org.eclipse.persistence.queries.datareadquery.executenoncursor(datareadquery.java:226) @ org.eclipse.persistence.queries.datareadquery.executedatabasequery(datareadquery.java:152) @ org.eclipse.persistence.queries.databasequery.execute(databasequery.java:899) @ org.eclipse.persistence.queries.datareadquery.execute(datareadqu

c# - How references are copied to the build folder? -

i have project references project b. project b has reference entityframework nuget package (6.1.3). package installs 2 dll : entityframework , entityframeork.sqlserver. there no reference entityframework project a. when build project a, in bin folder, there project b dll , entityframework dll. there not entityframework.sqlserver dll. , because of that, project not run well. why of project b dependencies copied main project build folder not dependencies ? (both has "copy local" properties set on true) sorry english, not native speaker. it because there no code in projects used entityframeork.sqlserver , vs thinks there no dependency , not copy it. use workaround: public class mycontext : dbcontext { //workaround force sqlserver dll copy private static sqlproviderservices instance = sqlproviderservices.instance; } you can add reference entityframeork.sqlserver a project , set copylocal true it.

javascript - Show html elements based on object property in Angular JS -

this code showing simple drop down list var products = [ { "id": 1, "name": "product 1", "price": 2200, "category": "c1" }, { "id": 1, "name": "product 2", "price": 2200, "category": "c2" }, { "id": 1, "name": "product 3", "price": 2200, "category": "c1" }, { "id": 1, "name": "product 4", "price": 2200, "category": "c3" }, { "id": 1, "name": "product 5", "price": 2200, "category": "c3" } ]; <div ng-repeat="product in products" class="dropdown"> <button clas

python - More elegant way to ignore static urls in Middleware in Django? -

middleware-wizards, i wondering if there more elegant way find out whether request serves 1 of custom view methods or rather static content etc. instead? class mymiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): if view_func.__name__ != 'serve': # here return none if serving static files via static_url can check request.path . ( process_request ) def process_request(request): if request.path.startswith(settings.static_url): # here anyway that's applicable during development cause apache or nginx or cdn serving static files , requests never hit django app.

JQGrid ASP.net C# add edit delete not updating in database -

i using demo jqgrid asp.net c# http://www.trirand.net/examples/grid/editing_data/edit_add_delete/default.aspx data updating , deleting in jqgrid not in database, how can update in database also?? in delete function create datatable , push data database. did not exec delete command in database. works not delete database.

html - Tumblr theme getting tags of a post in JavaScript -

i want use tags of post in javascript. tags using following: <article class="post" data-tags="{tagsasclasses}"> this worked fine until needed use special characters | becomes _ property , gives me wrong tag. so need (using {block:tags} ): <article class="post" data-tags="{block:hastags}{block:tags}{tag}{/block:tags}{/block:hastags}"> yet foresee problems if {tag} ever has double quote in it. is there way can keep data-tags attribute , still use {block:tags} real tag? i have come solution involves adding , reading bunch of markup don't much. <div class="posthiddentags" style="display:none;"> {block:hastags} {block:tags}<div data-tag={jstag} data-tagurl={jstagurl}></div>{/block:tags} {/block:hastags} </div> if need tags in javascript, can define them in <script> tag start. in theme html: <script> var tags = {}; {block

Python: how to revise tuples in an list? -

i have list of x,y tuples. think of these original tuples being change in x , y. wish apply these subsequent changes in x , y previous tuple. ex, after 0 term, x gained 100 , y stayed same. new first term (100,100). after that, x stayed same , y decreased 100. applying revised first term result in revised second term of (100,0) , etc. xy = [(0,100), (100,0), (0,-100), (-100,0)] this desired result: xy = [(0,100), (100,100), (100,0), (0,0)] how work around immutabilty of lists? how done in loop? the list still mutable; replace tuples new ones: x, y = 0, 0 i, (dx, dy) in enumerate(xy): x += dx y += dy xy[i] = (x, y) demo: >>> xy = [(0, 100), (100, 0), (0, -100), (-100, 0)] >>> x, y = 0, 0 >>> i, (dx, dy) in enumerate(xy): ... x += dx ... y += dy ... xy[i] = (x, y) ... >>> xy [(0, 100), (100, 100), (100, 0), (0, 0)]

c++ - What is the most effective data structure to use in my Neural Network program? Does my program require dynamic allocation -

i have background in java , trying learn c++. trying write neural network program, struggling fundamental concepts regards memory allocation. question concerned network class. in network constructor need initialize array of pointers arrays of neuron objects , pass network class variable layers . not believe need use dynamic memory allocation (i.e. vectors) because know size of arrays @ compile time (obviously correct me if i'm wrong here). should declaring arrays in constructor , extending scope unique_ptr ? or there way initialize arrays class variable , somehow define sizes in constructor. any suggestions on other parts of code welcome. trying learn as can here. also can find resources on stuff? of c++ resources have found cover basics. network.h class network { public: size_t numlayers; size_t* layersizes; //array of ptrs array of neurons /*here need 2 dimensional array of neurons each column layer (array) of neurons in network*/ vector&

Accessing FitBit API via R (no web scraping) -

does have working r script access api? see there webscraping package, i'd prefer use official api if possible. everything i've got , research i've done authenticate via oauth 1 or 2 seems broken using httr package. for oauth 2: library(httr) app = '<oauth 2.0 client id>' key <- '<client (consumer) key>' secret <- '<client (consumer) secret>' accesstokenurl <- 'https://api.fitbit.com/oauth2/token' authorizeurl <- 'https://www.fitbit.com/oauth2/authorize' fbr <- oauth_app(key,app,null) fitbit <- oauth_endpoint(null, authorizeurl,accesstokenurl) token <- oauth2.0_token(fitbit,fbr,scope='profile',as_header=true, cache=false) when check token$credentials error message: $errors $errors[[1]] $errors[[1]]$errortype [1] "oauth" $errors[[1]]$fieldname [1] "n/a" $errors[[1]]$message [1] "no authorization header provided in request. each call fitbit api shoul

Simple Recursion in Javascript with/without a subroutine -

i'm stuck on how find max value of array recursively in javascript. tried first iteratively , of course works. recursively, wanted try subroutine first, , without subroutine. what's best way call subroutine inside itself? getting tripped want inside indices, subroutine accepts array parameter. function maxvalue(arr) { var max = 0; (var = 0; < arr.length; i++) { if (arr[i] > max) { max = arr[i]; } } return max; } console.log(maxvalue([2, 7, 8, 3, 1, 4])); //returns 8 function maxvaluerecursive(arr) { var length = arr.length; //6 var max = 0; function dosearch(arr) { if (arr.length === 1) { max = arr[0]; } else { // true max = math.max(arr[length - 1], arr[length - 2]); //max = math.max(4, dosearch()) = 4. } return max; } return dosearch(arr); } console.log(maxvaluerecursive([2, 7, 8, 3, 1, 4])) //returns 4 you can use math.max , solve smaller bit of array @ each step. trick remove (

Verify this matlab code -

Image
i want plot fractal generated functions: x(k+1)=y(k)(1+sin(0.7x(k))-1.2+sqrt(|x|)) y(k+1)=0.21-x(k) with initial conditions y(0)=x(0)=0, did following code. x=zeros(100); y=zeros(100); x(1)=0; y(1)=0; k=1:100 x(k+2)=y(k+1)(1+sin(0.7x(k+1))-1.2+sqrt(abs(x+1))) y(k+2)=0.21-x(k+1) end plot(x,y,'.') so, right?, or how can fix if wrong?, thing want have fractal,but have run out , gave me isolated points, requirement not join them, therefore want know of code has right sintaxis , works well, thing if doing right thing ;) thanks lot help. edition x=zeros(100); y=zeros(100); x(1)=0; y(1)=0; k=0:100 x(k+2)=y(k+1)*(1+sin(0.7*x(k+1))-1.2*sqrt(abs(x(k+1)))); y(k+2)=0.21-x(k+1); end plot(x,y,'.') using code provided, added line print("mypng.png", "-dpng") , ran code saturn fiddle . x=zeros(100); y=zeros(100); x(1)=0; y(1)=0; k=0:100 x(k+2)=y(k+1)*(1+sin(0.7*x(k+1))-1.2*sqrt(abs(x(k+1)))); y(k+2)=0.21-x(k+1); end plot

c# - Create text file in asp.net using code -

how create text file using asp.net? tried using streamwriter writes exist file: using (streamwriter _testdata = new streamwriter(server.mappath("~/data.txt"), false)) { _testdata.writeline(txttext.text); // write file. _testdata.writeline(txtlink.text); // write file. } so how create it. have tried: filesystemobject.createtextfile(filename[,overwrite[,unicode]]); but did not work. string filepath = server.mappath("filename.txt"); string filecontent = "put file content here"; file.writealltext(filepath, filecontent);

shell - Remove alphanum,num,email and other special char from the 6th field of a file -

my city field ie 6th field has got addr,door #, email addr , special char in it,which getting job harder.i wanted replace numbers, email id,special char , other address city field of file blank space. want valid city names in there. tried awk awk -f'|' '$6 ~ /^[ ]*[0-9]{5}[ ]*$/' , not getting me want. can me in advising soln or tell me i'm going wrong.i'm great have participation here.sorry making page convoluted my data like: name,age,loc,num,st,city,postal,sal,year,status1,status2,status3,s4 garry",30",us",7373",ny",newyork",7900",100",2010",0",0",0",0 raj",40",in",1291",in",newdelhi",8790",100",2012",1",1",1",1 kris",24",us",6328",nj",9012 cain street",8739",200",2012",0",1",1",1 romy",57",it",5623",oh",1900 obama st #4",3434",200"

objective c - How to package CocoaPods dependencies in iOS ANE -

Image
i'm trying create ios googlemaps ane, i'm having troubles resulting packaged ane. i'm able create ane, when try create ipa using resulting ane, "id: file built unsupported file format" error: in order use googlemaps in objective-c, cocoapod dependency must downloaded, must packaging problem. the question is, correct way package cocoapod in ane? my current platformotions.xml contains following code: <platform xmlns="http://ns.adobe.com/air/extension/18.0"> <sdkversion>7.0.0</sdkversion> <linkeroptions> <option>-rpath @executable_path/frameworks</option> </linkeroptions> <packageddependencies> <packageddependency>libpods.a</packageddependency> <packageddependency>frameworks/googlemaps.framework</packageddependency> </packageddependencies> </platform> this ane package: hope can me.

algorithm - Scala code to check if parenthesis are balanced -

i'm writing scala function check balanced parentheses. "()","([]{})" both balanced, ")","(){[}]" aren't balanced below code wrote should working. have no idea why say's false inputs try. package general import scala.collection.mutable.stack import scala.collection.immutable.hashmap object balanceparen { def main(args: array[string]) { print(isbalanced("()")); } def isbalanced(input: string): boolean = { val stack = new stack[char] val brace = hashmap('(' -> ')', '[' -> ']', '{' -> '}') input map (( ch: char ) => { if( brace contains ch ) stack push ch else { if( brace.isempty ) return false if( brace.get(stack.pop) != ch ) return false } }) return stack.isempty } } hashmap 's get method returns op

deep - Modifying perform function in Theano.tensor.nnet.softmax -

i have begun using lasagne , theano machine learning on python. i trying modify softmax class in theano. want change how activation function(softmax) calculated. instead of dividing e_x e_x.sum(axis=1), want divide e_x sum of 3 consecutive numbers. for instance, result follows: sm[0] = e_x[0]/(e_x[0]+e_x[1]+e_x[2]) sm[1] = e_x[1]/(e_x[0]+e_x[1]+e_x[2]) sm[2] = e_x[2]/(e_x[0]+e_x[1]+e_x[2]) sm[3] = e_x[3]/(e_x[3]+e_x[4]+e_x[5]) sm[4] = e_x[4]/(e_x[3]+e_x[4]+e_x[5]) sm[5] = e_x[5]/(e_x[3]+e_x[4]+e_x[5]) and on... the problem cannot quite grasp how theano carries out computation. here main question. suffice change perform() function in softmax class? here original perform() function: def perform(self, node, input_storage, output_storage): x, = input_storage e_x = numpy.exp(x - x.max(axis=1)[:, none]) sm = e_x / e_x.sum(axis=1)[:, none] output_storage[0][0] = sm here modified perform() def myperform(self, node, input_storage, output_storage): x,

.net - Can C# implicit operator's be used to set a property? -

i'm trying use implicit operators make using library, bit easier. i know can get value implicitly, not sure how set value, if can done easily. here's pseduo code i'm thinking in head ... public class int32notified : inotifypropertychanged { private int _value; public int value { { return _value; } set { _value = value; onpropertychanged("value"); } } public event propertychangedeventhandler propertychanged; public static implicit operator int(int32notified value) { return value.value; } private void onpropertychanged(string propertyname) { var handler = propertychanged; if (handler != null) { handler(this, new propertychangedeventargs(propertyname)); } } } and i'm thinking .. when using it.... public class foo { // yeah, i've not wired event... (yet) public int32notified age { ge

sql server - Sql Query for the following output -

i have 2 tables: table_1: (name, street, city) table_2: (name, teacher_name) the column name in table_1 contains student's name teacher's name while in table_2 column name contains student's name , teacher_name contains teacher's name corresponding student. so question sql query finding students live in same street , city teachers. please , in advance. you need join table_1 twice. so: select students.name, teachers.name table_2 teacher_student join table_1 students on students.name = teacher_student.name join table_1 teachers on teachers.name = teacher_student.teacher_name students.street = teachers.street , students.city = teachers.city

angularjs - How to specify function name on $http.get status? -

i have angular function looks this. function request($scope, $http) { $http.get("http://www.w3schools.com/angular/customers.php") .success(function (response) { $scope.names = response.records; }); } i replace anonymous function regular function rid of ugly indentation. not sure doing because have not success. basically, to this. function request($scope, $http) { processgoodstatus = function (response) { $scope.names = response.records; } $http.get("http://www.w3schools.com/angular/customers.php") .success(processgoodstatus); } how ? help. you forget use var declare var processgoodstatus = function (response) { $scope.names = response.records; }

php - splitting input words into an array -

i have little experience php , regular expressions. created simple html input form , submit button. following: when button clicked, regexp splits input string array of words: that lowercase (with ã changed a) and 10 symbols long. should that? $search_string = $_get['keywords']; $regexp = preg_split(^[a-za-z]{1,10}+$, $search_string); $regexp = strtolower($search_string); this simple html code: <div> <label for="keywords">keywords:</label> <input type="text" name="keywords"> </div> <input type="submit" value="add records"> can me improve regexp code? doesn't seem working. this code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <form action="htmlform.php" method="post"> keywords

How to automatically share posts to facebook on iOS like Twitter -

i'd share posts facebook using facebook ios sdk. want system twitter, if set facebook share function on, twitter automatically share tweet facebook. i've implemented following, ask users. wanna make post automatically. if have advice, please tell me. thank kindness. var content: fbsdksharelinkcontent = fbsdksharelinkcontent() content.contenturl = nsurl(string:"https://~~~~~~~~~~~~~~") var sharebutton: fbsdksharebutton = fbsdksharebutton() sharebutton.sharecontent = content sharebutton.center = self.view.center self.view.addsubview(sharebutton)

ios - Sort dictionary based on value and extract the corresponding keys -

i have dictionary data structure in swift key,value pair, want sort dictionary in descending order based on value , top 3 keys corresponding top 3 values. example: before sort: dictionary<'a', 8> dictionary<'b', 23> dictionary<'c', 56> dictionary<'d', 3> dictionary<'e', 9> dictionary<'f', 20> after sort: dictionary<'c', 56> dictionary<'b', 23> dictionary<'f', 20> dictionary<'e', 9> dictionary<'a', 8> dictionary<'d', 3> so need c, b , a to first 3 keys associated dictionary's sorted values, (1) sort array values, (2) keys in order sorted array, (3) pull out first 3 keys array: let dict = ["a":8, "b":23, "c":56, "d":3, "e":9, "f":20] // sort dictionary values let sortedarray = sorted(dict, {$0.1 > $1.1}) // array of keys s

How to Image scroll in Horizontally after click on next button in iOS -

in application want create image gallery. used repagedscrollview. able scroll image on scrolling. i'm unable change image when click on next , previous button. how achieve functionality? multiple image change after scrolling, work perfectly. tried below code change image after click on next button. - (void)viewdidload { [super viewdidload]; scrollview = [[repagedscrollview alloc] initwithframe:self.slider_view.bounds]; scrollview.delegate=self; } - (void)scrollviewdidscroll:(uiscrollview *)scrollview1 { if(scrollview1.tag ==0){ cgfloat pagewidth = scrollview1.frame.size.width; current_page = floor((scrollview1.contentoffset.x - pagewidth / 2.0) / pagewidth) + 1; self.index_lbl.text = [nsstring stringwithformat:@"%d of %lu",current_page+1,(unsigned long)[self.seletedfile count]]; } } -(ibaction)nextbtn:(id)sender { } in next button method do: [scrollview scrolltopagewithindex:current_page + 1 animated:yes];

html5 - How to keep the multiple selected value in dropdown using jstl tags? -

//this jsp code......... <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <html> <head> <title>drop down</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#delete").click(function(){ var d = []; $.each($("#delete option:selected"), function(){ d.push($(this).val()); }); var s=(d.

javascript - How to export html page to ms. word (.doc) with external CSS? -

i want export html page .doc format external css. i'm using jquery.wordexport.js , filesaver.js . this want export: <div id="export">content</div> and js: <script type="text/javascript"> jquery(document).ready(function($) { $("a.word-export").click(function(event) { $("#export").wordexport(); }); }); </script> i include external css: <link href="css/style.css" rel="stylesheet"> i can export html page word, problem doesn't let me include external css. works inline css makes code looks messy , have type same style every page. , also, doesn't read margin , padding, cannot manage position of text. can me? appreciate it. thank you! you can put full path (absolute paths) of css file <link href="{absolute paths}css/style.css" rel="stylesheet"> beause ms-word can't read relative path. example

c# TransactionScope time out -

in c code im using transaction scope. but gives timeout exception after 10mins below; system.transactions.transactionabortedexception: transaction has aborted. ---> system.timeoutexception: transaction timeout --- end of inner exception stack trace --- @ system.transactions.transactionstateaborted.begincommit(internaltransaction tx, boolean asynccommit, asynccallback asynccallback, object asyncstate) @ system.transactions.committabletransaction.commit() @ system.transactions.transactionscope.internaldispose() @ system.transactions.transactionscope.dispose() i have following configuration in web.config file; <system.transactions> <defaultsettings timeout="22:00:00" /> </system.transactions> why im still getting timeout? how fix issue? please advice me. check machinesettings/maxtimeout value in %windir%\microsoft.net\framework64\v4.0.30319\config\machine.config file (you may need alter path if you're using

JQuery with ASP.Net Master Page -

Image
i have been searching answer problem hours , tried every example google search. i trying upload file using jquery , part of asp.net master page. when test script on regular page works fine. when put in master page nothing happens. here master page <head runat="server"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title></title> <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js"></script> <script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script> <link href="css/grid.css" rel="stylesheet" type="text/css" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href='https://fonts.googleapis.com/css?family=open+sans:400,600,700,300' rel='stylesheet' type=&#

ms word - DOCX openxml default character style -

i take new docx document single run , try add <w:style w:type="character" w:default="1" w:styleid="qqq"> <w:rpr> <w:b/> </w:rpr> </w:style> into word/styles.xml/w:styles. expect see text inside run bold, don't. run has no references other styles. if change w:type "paragraph", run becomes bold . ecma-376, seems style type='character' should affect runs. if doesn't, purpose of w:type="character"? thanx its fair question. you can affect runs modifying w:docdefaults/w:docdefaults: <w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"> <w:docdefaults> <w:rprdefault> <w:rpr>

php - Redirect non-www to www with .htaccess affecting pagespeed score -

i'm redirecting web page non-ww www using htaccess rewritecond %{http_host} ^mywebsite.com [nc] rewriterule ^(.*)$ http://www.mywebsite.com/$1 [l,r=301] but degrades pagespeed point 6 points avoid landing page redirects reason. any idea how fix this? that because redirect being triggered so request (mywebsite.com) -> response (redirect www.) -> request (www.mywebsite.com) -> response if directly test www.mywebsite.com 2 redirect steps avoided , page speed score increase.

c# - Data type mismatch -

i got error when tried select userid database datatable. first userid autonumber, second userid number, , database ms access db. private void () { odbcdataadapter ad = new odbcdataadapter("select userid userinfo badgenumber='" + userid + "'", this.fm.cn); datatable t = new datatable(); ad.fill(t); ad.dispose(); if (t.rows.count > 0) { odbccommand cmd = new odbccommand(); cmd.connection = this.fm.cn; string id = t.rows[0][0].tostring(); //check date odbcdataadapter add = new odbcdataadapter("select userid checkinout userid='" + id + "'", this.fm.cn); datatable tc = new datatable(); add.fill(tc); // <- gotta error here. add.dispose(); } } change query to: "select userid checkinout userid=" + id in sql queries, strings literals (or chars) required enclosed within pair of single quotes ' , used delimiter

sql - User Defined Function to determine whether string contains a substring -

i have code returning 0 regardless if string contains substring or not. should return 1 if substring found. create function dbo.checkletters (@message varchar) returns integer returns null on null input begin declare @value integer; if @message '%findme%' set @value = 1 else set @value = 0 return @value end; i tried using charindex in if statement no avail. missing simple here? testing so: select dbo.checkletters('dlhld'); use (@message varchar(max)) input parameter. or instead of max specify length, in function 1. issue.

How to create bigrams using dictionary in R? -

i have dictionary of words have stored in dictionary.txt file. contains trigrams , bigrams. given paragraph: "in order perform operations inside abdomen, surgeons must make incision large enough offer adequate visibility, provide access abdominal organs , allow use of hand-held surgical instruments. these incisions may placed in different parts of abdominal wall. depending on size of patient , type of operation, incision may 6 12 inches in length. there significant amount of discomfort associated these incisions can prolong time spent in hospital after surgery , can limit how patient can resume normal daily activities. because traditional techniques have long been used , taught generations of surgeons, available , considered standard treatment newer techniques must compared." the dictionary.txt file includes following words: hand-held surgical instruments intensive care unit traditional techniques now want create bigrams words not present in dictionary.txt.