Posts

Showing posts from March, 2011

php - using wp_authenticate() to redirect certain users when logging in -

our website using wordpress - woocommerce login page customers login. i trying use wp_authenticate() achieve following: 1) customer login our new website, enter username , password, , hit login button. in case want see woocommerce login file, click here . 2) our new website goes through list see if username matches. if username matches, don't @ password, redirect user other url such google.com 3) if username doesn't match our list, let them login usual. with jquery, helped me come following code: var names = new array(”bill”, ”jim”, ”bob”); // names array, , in uppercase var dest_url = ”http://www.website.com”; // url want send them jquery(document).ready(function () { jquery(”input[name=’login’]”).click(function(event){ event.preventdefault(); // prevent default form action var current_name = jquery(”#username”).val(); current_name = current_name.trim().touppercase(); if ( -1 != jquery.inarray(current_name, names) ) { alert(”redirecting ” + current_name + ” ”

hadoop - Compare tuples on basis of a field in pig -

(abc,****,tool1,12) (abc,****,tool1,10) (abc,****,tool1,13) (abc,****,tool2,101) (abc,****,tool3,11) above input data following dataset in pig. schema : username,ip,tool,duration i want add duration of same tools output (abc,****,tool1,35) (abc,****,tool2,101) (abc,****,tool3,11 use group , use sum on duration. a = load 'data.csv' using pigstorage(',') (username:chararray,ip:chararray,tool:chararray,duration:int); b = group (username,ip,tool); c = foreach b generate flatten(group) (username,ip,tool),sum(a.duration); dump c;

php - changing data in a div -

first off let me state i'm not web developer , i'm learning on way. might not possible or might horrible idea. if please let me know , if not please point me in right direction. i developing website , got of foundation done it, 1 section. section i'm working on have little data 1 set of data or have 40+ sets of data. i'm trying come way of displaying data. oh sets mean @ min. have 4 rows of data displayed (audio, format, location, etc). i thinking of using breadcrumbs keep track of user position , below have links in div. oh might mention i'm dealing tv shows. thinking first link format type. once type clicked show seasons related format. show links of different season. when 1 link clicked , see if there collections season (some shows break seasons collections , make difficult since there no default standard). either show disc involved , have them click , show data associated disc or show disc data associated season and/or collection. i thinkin

jquery - Refreshing old XHR Header -

i came across scenario need refresh xhr header ajax calls. here scenario, let's loaded page making ajax call 1 of custom xhr header holding value "abc". if close page , reopen (using ctrl + shift + t in case of chrome) page makes server side call same xhr header value "abc". is there way can change value else when reopen page xhr header has different value. just curious! suggestions welcome.

python - Django update model entry using form fails -

i want update model entry using form. problem instead of updating entry creates new entry. def edit(request, c_id): instance = get_object_or_404(c, id=int(c_id)) if request.post: form = cform(request.post, instance=instance) if form.is_valid(): form.save() return redirect('/a/b', c_id) else: form = cform(instance=instance) args = {} args.update(csrf(request)) args['form'] = form args['c_id'] = c_id return render_to_response('a/b.html', args) html code: <form action="/a/edit/{{ c_id }}/" method="post"> {% csrf_token %} {% field in form %} <div class="fieldwrapper"> {{ field.errors }} {{ field.label_tag }} {{ field }} {% if field.help_text %} <p class="help">{{ field.help_text|safe }}</p> {% endif %}

How to express mutually exclusive inheritance in UML? -

Image
how exemplify class can inherit either of 2 super-classes, not both? the class property can either represent set of numbers, or cardinal number, not both @ same type. your sub classing upside down. need set property , cardinal property specialize property . if subclasses have characteristics of set , cardinal , subclass well.

javascript - Ajax success function not triggered even though the request to the API is made succesfully why? -

i don't know why success function not triggered error function executed though when make post request api happens planned. this js: $("form").submit(function (env) { env.preventdefault(); $("#submitbtn").prop('disabled', true); $("#form_result").text(""); var request = json.stringify($("#newrequest-form").serializeobject()); console.log(request); $.ajax({ method: "post", url: "/api/holidays", data: request, contenttype: "application/json", datatype: "json", success: function () { $("#form_result").text("submitted succesfully"); $(this).prop('display', 'hidden'); }, error: function (error) { $("#form_result").text("error: creating request"); $("#submitbtn").prop('disabled'

c++ - Gcc fails with "call of overload is ambignuous" while clang does not -

i have following code: #include <experimental/string_view> struct b_symbol { template <typename t> explicit b_symbol(t&& symbol) : symbol(std::forward<t>(symbol)) { } std::experimental::string_view symbol; }; struct b_utf8 { template <typename t> explicit b_utf8(t&& value) : value(std::forward<t>(value)) { } std::experimental::string_view value; }; struct value { explicit value(b_utf8) {} explicit value(b_symbol) {} }; int main() { value v({b_utf8("test")}); } you can try on godbolt . if compile clang (3.8.0): clang++ oload.cpp -std=c++1y runs fine. if compile gcc (6.1.1 20160602) g++ oload.cpp -std=c++1y get: oload.cpp: in function ‘int main()’: oload.cpp:30:29: error: call of overloaded ‘value(<brace-enclosed initializer list>)’ ambiguous value v({b_utf8("test")}); ^ oload.cpp:25:14: note: can

javascript - AngularJS $locationChangeStart never called -

i have simple code using $location service in angular not work. angular.module("app",[]).run(function($rootscope) { var $offfunction = $rootscope.$on("$locationchangestart", function(e) { if (confirm("are sure")) return $offfunction(); return e.preventdefault(); }); }); i want confirm if user wants leave page, won't work if try change address in bar or if press button in browser. here fiddler: http://jsfiddle.net/5dnm2/19/ you have add $location initialization provider. visit http://jsfiddle.net/5dnm2/41/ run(function($rootscope, $location) {...})

infragistics - How to send a date with offset to the server while adding a new entry into Ignite UI ig.Grid table -

i'm using ignite ui 16.1 iggrid restdatasource. please, consider following configuration of 1 of grid's columns: { headertext: $.i18n._("from"), key: "start", validation: true, required: true, datatype: "date", editortype: "date", format: "hh:mm", editoroptions: { validatoroptions: { dateinputformat: "hh:mm", onblur: true, onchange: true } }, readonly: false } when new row adding, in payload of post/create request start:"/date(1470636037642)/" sent server, parsed default mvc model binder utc date. absolutly in unison ignite ui documentation states dates sent in utc. could

java - How to compile dynamic library with static files (.a) for a JNI application on linux? -

i'm using ubuntu 14.04 i'm new in jni i'm not familiar in jni , english. i'm using ubuntu 14.04 what did java class hello { public native void sayhello(); static { system.loadlibrary("myapp"); } public static void main(string[] args){ new hello().sayhello(); } } compile java code , make header file command javac hello.java javah hello c code #include "myapp.h" jniexport void jnicall java_hellojni_sayhello (jnienv *env, jobject job ){ printf("saying hello\n"); } compile c code command (and have 5 static compiled library *.a). gcc -shared -fpic -o libmyapp.so -i"path/to/include/jni" -i"path/to/include/myapp" path/to/lib/libmyapp1.a path/to/lib/libmyapp2.a path/to/lib/libmyapp3.a path/to/lib/libmyapp4.a path/to/lib/libmyapp5.a -lm -lpthread -lc -lz hello.c that generates file libmyapp.so after compilation, check function naming nm: $ nm

php - Matlab - Unspecified Fault: SOAP Fault: Procedure 'procedure_name' not present -

i have php soap server (services.php) <?php require_once 'etd_n.php'; require_once 'scengen.php'; require_once 'sickevo.php'; require_once 'logevo_n.php'; require_once 'logevo.php'; require_once 'damager.php'; $server= new soapserver("webservice.wsdl", array('cache_wsdl' => wsdl_cache_none)); $server->addfunction(soap_functions_all); $server->setclass('soap'); $server->handle(); ?> and related wsdl file queried clients. if call soap server php client or java client, works fine , smooth. if try call server matlab methods (matlab.wsdl.createwsdlclient(' http://xxx.xxx.xxx.xxx/webservices/project/webservice.wsdl ' , 'c:\users\jdoe\matlabtemp\project') , runs fine until client tries read list of procedures provided server. infact, when matlab client tries read procedures listed server, get: unspecified fault: soap fault: procedure 'procedure_name' not present .

IntelliJ run TestNG tests in 1 directory -

Image
i have separated unit , integration tests separate intellij "test sources" directories. when right-click on unit test folder , attempt run tests, integration tests roped in well. i able right-click on unit test folder , have tests under folder run , same integration tests. is there way in intellij or going have use testng.xml file accomplish this? how using 2 test groups , creating 2 run configurations, 1 unit testing , 1 integration testing: 1) dummy test class simulates both categories import org.testng.annotations.test; public class categorytests { @test(groups = "unit") public void someunittest(){ } @test(groups = "integration") public void someintegrationtest(){ } } 2) unit test ij run config (notice group setup) 3) integration test ij run config (again, notice group setup) 4) in 1 sample

php - Postfix sending mails successfully but receivers don't get them -

i've tried using postfix smtp server sending "verification" mails locally, provided destination. current problem is, sends mails without issues receivers don't them. i'm using xenforo software "127.0.0.1:25" smtp data sending mails, without user - / pass login because postfix locally bound , should only send mails - not receiving outside. also i'm using custom domain provide "from:" data mail. (e.g. "no-reply@*******.com") i tried using smtp servers of different hosts such "mailjet" had same issue there. staff of used hosts said, there'd wrong server , nothing else, that's why had decided host own smtp server locally on same server webserver's running. postfix "main.cf" file: http://pastebin.com/r8efkbxl logs: http://pastebin.com/tnjvbnfp thanks in advance. sincerely, chris and have spf, dkim, etc. sorted? suggest (authenticate and) use same smtp server use other e

How to write a macro in Rust to match any element in a set? -

in c, i'm used having: if (elem(value, a, b, c)) { ... } which macro variable number of arguments avoid typing out if (value == || value == b || value == c) { ... } a c example can seen in varargs `elem` macro use c . is possible in rust? assume use match . if so, how variadic arguments used achieve this? macro_rules! cmp { // hack rust v1.11 , prior. (@as_expr $e:expr) => { $e }; ($lhs:expr, $cmp:tt $($rhss:expr),*) => { // bind `$lhs` name don't evaluate multiple // times. use leading underscore avoid unused variable warning // in degenerate case of no `rhs`s. match $lhs { _lhs => { false || $( cmp!(@as_expr _lhs $cmp $rhss) ) || * // ^- used *separator* between terms }} }; // same, "all". ($lhs:expr, $cmp:tt $($rhss:expr),*) => { match $lhs { _lhs => { true && $( cmp!(@as_expr _lhs $c

jsf 2 - PrimeFaces 5.3.5 - treeNode custom icons are invisible instead of it. There is ^ -

<p:tree value="#{userfiltersbean.objectstreemodel}" var="node" hiderootnode="true" styleclass="filterstree"> <p:treenode icon="#{node.leaficon}" styleclass="myiconssize"> it works not see custom icons. see ^. see screenshot. ^ primefaces 3.0 - how can set treenode icon programmatically backing bean? 1st approach not working .ui-menu .ui-icon { top: .2em; left: .2em; } 2nd approach reduced size of icon , nothing happened. see ^. .myiconssize { width:8px; height:8px; } 3rd approach works puts last icon of tree component var (var="node") each nodetree. see screenshot here .ui-treenode .ui-treenode-content .ui-treenode-icon{ background: url("#{node.leaficon}") no-repeat top !important; } and there generated html output. <span class="ui-tree-toggler ui-icon ui-icon-triangle-1-e"></span> <span class="ui-treenode-icon ui-icon

c# - how to call single instance class from App.xaml.cs -

i have application should allowed run 1 instance per user session. if user clicks launch application again, want bring 1 focus. followed steps in tutorial wpf single instance application and steps in tutorial : step 1: add file singleinstance.cs project. step 2: add reference project: system.runtime.remoting. step 3: have application class implement isingleinstanceapp (defined in singleinstance.cs). the method in interface is: hide copy code bool signalexternalcommandlineargs(ilist args) method called when second instance of application tries run. has args parameter same command line arguments passed second instance. step 4: define own main function uses single instance class. your app class should similar this: hide copy code /// step 5: set new main entry point. select project properties –> application , set “startup object” app class name instead of “(not set)”. step 6: cancel default wpf main function. right click on app.xaml, properties, set b

Resolve named registration dependency in Unity with runtime parameter -

i have following problem. register components , initialize them in unity (example console application): public class sharepointbootstrapper : unitybootstrapper { ... public object initialize(type type, object parameter) => container.resolve(type, new dependencyoverride<iclientcontext>(container.resolve<iclientcontext>(parameter.tostring())), new dependencyoverride<itenantrepository>(container.resolve<itenantrepository>(parameter.tostring()))); public void registercomponents() { container .registertype<iclientcontext, sharepointonlineclientcontext>(sharepointclientcontext.online.tostring()) .registertype<iclientcontext, sharepointonpremiseclientcontext>(sharepointclientcontext.onpremise.tostring()) .registertype<itenantrepository, documentdbtenantrepository>(sharepointclientcontext.online.tostring()) .registertype<itenantreposito

android - Monkey UI test on app with login -

i want run ui monkey test utility comes android sdk on app. the problem first screen in app login screen, , if not successful in screen not allowed see anything. this way, monkey tests stay in login screen, not being able go past that. is there solution this? i faced same problem while testing app espresso. solved creating product flavor in app.gradle this: productflavors { automated_test { buildconfigfield 'string', 'customflavor', '"automated_test"' } } now can check example in login activity if running product flavor , skip login process. if(buildconfig.customflavor.equals("automated_test")) { this.emailtext.settext(gettext(r.string.automated_test_username)); this.passwordtext.settext(gettext(r.string.automated_test_password)); login(); }

python - Select multiple sections of rows by index in pandas -

i have large dataframe gps path , attributes. few sections of path need analyse. subset sections new dataframe. can subset 1 section @ time idea have them , have original index. the problem similar to: import pandas pd df = pd.dataframe({'a':[0,1,2,3,4,5,6,7,8,9],'b':['a','b','c','d','e','f','g','h','i','j']}, index=range(10,20,)) i want o like: cdf = df.loc[[11:13] & [17:20]] # syntaxerror: invalid syntax desired outcome: b 11 1 b 12 2 c 13 3 d 17 7 h 18 8 19 9 j i know example easy cdf = df.loc[[11,12,13,17,18,19],:] in original problem have thousands of lines , entries removed, listing points rather not option. one possible solution concat : cdf = pd.concat([df.loc[11:13], df.loc[17:20]]) print (cdf) b 11 1 b 12 2 c 13 3 d 17 7 h 18 8 19 9 j another solution range : cdf = df.ix[list(range(11,14)) +

Can I retrieve filename for external table data in BigQuery? -

looking implement simple datastore departmental team manage load of excel/csv files. them prepare files , drop them in csv format gcs bucket , point external bq table @ (that works great). however, if run query , see data , want find data has been pulled from, how can find out (assuming there no contextual clues in filename) file contains row(s) in question? you can use _file_name pseudo column @ file row belongs external tables. note pseudo column works external tables. example: bq query --external_table_definition=externaltable::avro=gs://mybucket/f* 'select _file_name f externaltable'

python - An efficient way to save parsed XML content to Django Model -

this first question best conform question guidelines. i'm learning how code please eli5. i'm working on django project parses xml django models. podcast xmls. i have code in model: django.db import models import feedparser class channel(models.model): channel_title = models.charfield(max_length=100) def __str__(self): return self.channel_title class item(models.model): channel = models.foreignkey(channel, on_delete=models.cascade) item_title = models.charfield(max_length=100) def __str__(self): return self.item_title radiolab = feedparser.parse('radiolab.xml') if channel.objects.filter(channel_title = 'radiolab').exists(): pass else: channel_title= radiolab.feed.title = channel.objects.create(channel_title=channel_title) a.save() episode in radiolab.entries: item_title = episode.title channel_title = chan

javascript - onsubmit validation not working of 2 forms -

i have 2 forms in 1 div & using hide & show & have same validation both forms issue onsubmit validation not working in 1 form in other form validation working. function validateexpiry() { var today, someday; var exmonth=document.getelementbyid("exmonth").value; var exyear=document.getelementbyid("exyear").value; today = new date(); someday = new date(); someday.setfullyear(exyear, exmonth, 1); if (someday < today) { document.getelementbyid('invalidexpiry').innerhtml="invalid expiry date"; return false; } return true; } function validate_cvv(cvv) { var myre = /^[0-9]{3,4}$/; if(cvv.value.match(myre)) { return true; } else { document.getelementbyid('usernameerror').innerhtml="invalid cvv"; return false; } } <form name="card" id="card" onsubmit="return validateexpi

unit testing - Assert 403 Access Denied http status with PHPUnit test case -

i have custom error templates in projects 404, 403 , other exceptions. want create unit test case assert http errors. when logging user , accessing authorized page of vendor getting 403 access denied in browser in unit test case getting 404 page not found error. here test scenario: class errorexceptiontest extends webtestcase { public function testaccessdeniedexception() { $server['http_host'] = 'http://www.test.com/'; $client = static::createclient(array('debug' => false), $server); $client->disablereboot(); $session = $client->getcontainer()->get('session'); $firewall = 'main'; $token = new usernamepasswordtoken('user', null, $firewall, array('role_user')); $session->set("_security_$firewall", serialize($token)); $session->save(); $cookie = new cookie($session->getname(), $session->getid()); $clie

cordova - How can I achieve a surround sound effect for android in PhoneGap? -

how can achieve surround sound effect android in phonegap? there openal4android. how use in phonegap? i did bit more research , found web audio api, because earlier wasn't searching javascript specifically...i should sue myself. , there's channel splitter node , that's wanted.

php - Prepared Statement, Fails when re-used -

i have code, works fine when looped through once. <!-- language: php --> <?php $query = "select username users user_id = ? limit 1"; $stmt = $con->prepare($query) or die(mysqli_error($con)); $stmt->bind_param("s", $user_id); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($username); ?> when call first time on page, loads fine , data shows should. <!-- language: php --> <?php // 1 works fine. while ($stmt->fetch()){ echo 'welcome '.$username; } ?> if want re-use same query somewhere else, fails wihtout errors. doing wrong? correct way re-use same query multiple time on same page, since data same, don't want re-query db each time. <!-- language: php --> <?php // when re-used somewhere else on page, fails. nothing shows. while ($stmt->fetch()){ echo 'welcome '.$username; } ?> fetch returns 1 row after another. onc

java - Avoiding constant checking to ensure json object contains elements -

i'm writing code , have feeling of urgh when feels ugly , inelegant can't see immediate way avoid it. i have json object i'm getting third party. know expect can't sure each element there need check exists this: if (object.has(element)) { jsonobject element = object.get(element); } the problem have go pretty deep object , begins feel ugly when many nested ifs. here example: private boolean lineexists(jsonarray orders, line lineitem) { final string line_items = "lineitems"; final string elements = "elements"; final string note = "note"; boolean exists = false; log.debug("checking if line item exists in order..."); // if there no order payload order hasn't been posted there can't duplicate line item if (orders != null) { (int = 0; < orders.size(); i++) { jsonobject order = orders.get(i).getasjsonobject(); if (order.has(line_items)) {

Are user icons supported on root submenus in PrimeFaces 6.0 PanelMenu -

Image
i made panelmenu , tried add icon root submenu it's not working. <p:panelmenu> <p:submenu label="Üye işlemleri" icon="fa fa-user-plus"> <p:menuitem value="Üye kayıt" icon="fa fa-user-plus" action="#{redirect.toregister()}" /> <p:menuitem value="Üye düzenle" icon="fa fa-pencil" /> </p:submenu> <p:submenu label="kullanıcı işlemleri" icon="ui-icon-extlink"> <p:menuitem value="anasayfa" icon="fa fa-home" action="#{redirect.tomainpage()}" /> <p:menuitem value="Üye kayıt" icon="fa fa-user-plus" action="#{redirect.toregister()}" /> <p:menuitem value="Üye düzenle" icon="fa fa-pencil" /> </p:submenu> </p:panelmenu> do have idea? tried ui-icon (not fontaweso

r - add values to a dataframe every nth row or corresponding to a spec. column value -

r-noob here question not solve himself i hava data frame length of 250 head(abto, 20) see transekt plant blatt# breiteo breitez bez 1: abt 1 1 2.0182 5.3980 1 2: abt 1 1 1.9730 4.2522 1 3: abt 1 1 1.8024 3.7587 1 4: abt 1 2 2.2081 4.2880 2 5: abt 1 2 2.2858 6.1115 2 6: abt 1 2 1.8532 5.7426 2 7: abt 1 3 2.0384 4.9074 2 8: abt 1 3 2.0757 4.8801 2 9: abt 1 3 1.8034 4.6111 2 10: abt 1 4 1.9567 4.8879 2 11: abt 1 4 1.9080 5.0652 2 12: abt 1 4 1.8346 4.8862 2 13: abt 1 5 2.0282 4.5545 1 14: abt 1 5 2.1356 5.7157 1 15: abt 1 5 1.7594 6.1688 1 16: abt 2 1 1.6457 5.2868 1 17: abt 2 1 1.6942 5.0414 1 18: abt 2 1 2.0544

php - Laravel Associate method is returning empty array in the view -

Image
i working on simple social network, working on replies section now. associated post/status model user below, when tried access in view returns empty array [] . reply function in post model public function postreply(request $request, $statusid){ $this->validate($request, [ "reply-{$statusid}" => 'required|max:1000', ], [ 'required' => 'the reply body required' ] ); $post = post::notreply()->find($statusid); if(!$post){ return redirect('/'); } if(!auth::user()->isfriendswith($post->user) && auth::user()->id !== $post->user->id){ return redirect('/'); } $post = post::create([ 'body' => $request->input("reply-{$statusid}"), ]); $post->user()->associate(auth::user()); $post->replies()->save($

android - Retrofit 2 sequential Requests using asynchronous network calls with retry -

i trying send network request api using retrofit, , when response, use part of response in call, used call, , rxjava suggested, have second request executed before first one public interface channelrequest { @post("authenticate_with_options") @formurlencoded observable<channel> getauthenticationchannel(@fieldmap map<string, string> params); @post("check") @formurlencoded observable<channel> getauthenticationstatus(@fieldmap map<string, string> params); } ss observable<channel> call2 = mapi.getthechannel().getauthenticationstatus(constants.http.paramsauth); observable.interval(3, timeunit.seconds).retry(3); subscription subscription2 = call2 .subscribeon(schedulers.io()) // optional if not wish override default behavior .observeon(androidschedulers.mainthread()).subscribe(new subscriber<channel>() { @override

css - How can I make the text resize downwardly in responsive mode? -

i want <p> spread downwards below <h1> when resized in responsive. happens is, when resize window, when <p> breaks, <h1> 's position adjusted top, want static. `<h1>title</h1> <p>this long paragraph lorem ipsum sit amet dolor</p>`

Update the value of a dropdown menu in ReactJS -

in html form, have select menu. it’s profile user can edit later , change values. here firstcomponent code rendering form: export const firstcomponent = react.createclass({ handlelanguagecode: function(langvalue) { this.setstate({ language: langvalue }); }, renderfield() { return ( <div> <selectlanguage onselectlanguage={this.handlelanguagecode} defvalue={getvalue()} /> </div> ); } )} if user wants edit form, getvalue() send current value selectlanguage component. following code component: import { dropdownlist } 'react-widgets'; export const selectlanguage = react.createclass({ getinitialstate: function(){ return{ value: '', }; }, handlelangchange: function (val) { var name = val.name //this.props.onselectlanguage(val.id); //???

parsing - How to test grammar changes in yacc/lalr(1) for backwards compatibilitiy? -

we have our scripting language in use , improving adding new features etc. my question is; best way test our grammer backwards compatibility? knows tool makes or way it? best regards testing whether 1 grammar accepts same language another, or accepts larger language, difficult if not impossible in theory. as engineers, asked impossible. relax requirements until kind of useful answer. 1 way relax requirements allow tool "don't know" in cases. my company builds parsers based on parser generators. deal huge grammars (thousands of rules). 1 of mechanisms have been working on detect if grammar ambiguous. known impossible in theory, doesn't change our interest in getting answer. we working on tool can answer question in many cases. in effect ask if nonterminal ambiguous; applied root grammar rule directly asks if grammar ambiguous. reason trying on nonterminals many of them produce smaller sublanguages full language, allowing them analyzed. det

aws rds - max connections for t2.small aws RDS instances -

i need know how many connections can made t2.small rds instances, searched getting different answers every where, in t2.micro instances have 26 connections need know t2.small too... in advance t2.small can have maximum of 150 connections see link more info please : max_connections @ aws rds mysql instance sizes

java - Including comma in CSV file -

i working on importing data in csv file. stuck on deciding variable needs added field comma separated. below data - "acnumber","date","code" 12332,123 09/12/2012 1231 this desired format. how shows "acnumber","date","code" 12332 123 09/12/2012 ... actual data being sent string & in format below - "12332,13321","08/08/2016","1234" i have tried below following possible solutions - 1) surrounding code quotes suggested here ""12332,13321"" i have added 2 double quotes value covered in quotes.i have tried single double quotes well. 2) use of escape ("\") before comma in final output string "12332\,13321" i have googled on , still didn't found solution.kindly help. if want escape separator comma here supposed put content between double quotes if have 12332,123 should put "12332,123" in cs

.net 1.1 - How to detect character in gridview cell at vb.net 2003 -

i allow number in gridview cell value when user typing field.my framework dotnet 1.1 , miscosoft visual studio .net 2003.although try call gridview keypress event , key down event ,it not fire. addhandler yourgrid.editingcontrolshowing, addressof yourgrid_editingcontrolshowing then cast gridview textbox textbox

validation - vb.net Chr KeyPress function -

when validating textboxes in vb.net, use .chr or .chrw function define valid ranges of ascii values can entered. today came across i've not had before, had use function in e.keychar <> chr(156) format, replace value 156 value gbp sign, or £ however, after finding out online via ascii tables ascii value 156, ran code, , wouldn't let me enter £. fix this? there i'm missing? private sub txtfval_keypress(sender object, e keypresseventargs) handles txtfval.keypress if e.keychar <> chr(156) andalso e.keychar <> chr(46) andalso e.keychar <> chr(44) andalso e.keychar = chrw(keys.oemcomma) _ andalso (e.keychar < chr(48) orelse e.keychar > chr(57)) andalso e.keychar <> chr(8) e.handled = true end if end sub instead of having lookup ascii number specify char suffixing string c - in vb.net indicates you've specified char literal: if e.keychar <> "£"c andalso ... edit: here's mo

c - How to get the number of the instances of a struct existing in a running Linux kernel? -

suppose struct a structure of linux kernel code, , there may many instances of struct a being created , destroyed in running linux kernel, how can know number of instances of struct a existing right now? in general can't, unless can see structure instantiated in single way (if there constructor/factory function). for structures used on stack, there typically no such function (although it's possible since structure instances can returned values). c doesn't provide way automatically, you'd have build require finding places instances created.

AngularJS: functions doesn't work when setting route resolve and removing ng-controller directive -

i used route resolve prevent loading view before executing functions, read here error: unknown provider: employeesprovider <- employees have remove ng-controller , did <div > <!-- ng-controller="navbar" has removed here --> <div ng-include="'...../partitials/navbar.html'"></div> </div> here route provider $routeprovider .when("/erpdocumentation/", { templateurl : function(params){ // code here return template }, controller: "navbar", resolve: { filteredmodules: function (searchforservice) { return searchforservice.getfilteredmodules(); } } }); but, made functions no longer worked in navbar controller, example, when click button: <md-button ng-click="routetosearchpage (searchstring)"> , functions doesn't works in nav

typescript - NG2 Tree module not found after install on an Angular 2 new app -

i have install ng2-tree plugin in new angular 2 app (rc4), after following this . plugin has been installed, , on node_modules folder. i have tried use in component: import {component} '@angular/core'; import {treemodel, treecomponent} "ng2-tree"; @component({ selector: 'tree-side', templateurl: '../../pages/tree-side.html', directives: [treecomponent] }) export class treesidecomponent{ private tree: treemodel = { value: 'programming languages programming paradigm', children: [ { value: 'object-oriented programming', children: [ {value: 'java'}, {value: 'c++'}, {value: 'c#'} ] }, { value: 'prototype-based programming', children: [ {value: 'javascript'},

php - Prevent redirection to home page -

i have php website under development. website url http://www.iarlive.in . hosted on net4.in . on righthand side of page, have graphs displayed in iframe when click on links. working few days ago. had checked on 4 august 2016. unfortunately, when click on links graph not shown instead gets redirected home page. have verified problem not related iframe. can me? thanks sachin you have not mentioned here, whether using php framework or not, on basis of it, here have come below suggestion. step 1, try undo code did before 4 august or code tested last time on live server , working fine. step 2, debug using php functions exit(); , etc on each page. step 3, uncomment javascript files if have header.php or footer.php files .. hope helps or let me know further.

how to take backup of riak data -

does know how take backup of riak database. can restore previous point if goes wrong. according basho's site, have suggested rsync best strategy. can copy database files rsync , unable link newly created node in riak cluster. please help. the best advice on backing riak located here: http://docs.basho.com/riak/kv/2.1.4/using/cluster-operations/backing-up/ point-in-time backups possible challenging due nature of how data distributed around nodes , built in repair mechanisms riak employs when nodes leave , return cluster. if want restore cluster state in @ given point-in-time nodes need restored state @ same time means downtime (which riak designed avoid). as why unable restore node backup made don't provide enough information determine why restoration steps in documentation ( http://docs.basho.com/riak/kv/2.1.4/using/cluster-operations/backing-up/#restoring-a-node ) aren't working you.

php - Vtiger 6.3 Mail scanner hangs -

dears, using vtiger 6.3 i have problem regarding mail converter scan outgoing mail configured correctly crm sending emails mail box added correctly mail converter module imap module installed , enabled @ server ports correct within module files the problem when press "scan now" button, loading , don't else please turn off error reporting on webserver add following code config.inc.php @error_reporting(0); mailmanager module send request on index.php , receive response in json string format. if server return error vtiger javascript files cannot parse invalid json string. , page hang on loading page. also can change error reporting on config.inc.php see whats happening ini_set('display_errors','on'); version_compare(php_version, '5.5.0') <= 0 ? error_reporting(e_warning & ~e_notice & ~e_deprecated) : error_reporting(e_all & ~e_notice & ~e_deprecated & ~e_strict); // debugging also must enable

wso2 - how to customize the privileges to edit entitlement policies based on the role in admin UI? -

Image
i wanted give privileges few users edit few entitlement policies in wso2 identity server.is posible do? you can control permission of entitlement policy management of users, cannot applied per policy in default wso2 identity server. in wso2 identity server management console, can add role appropriate permissions managing entitlement policies. click on 'add' under 'users , roles' , select 'add new role'. give role name , click next permission tree. can select permission shown below,

Javascript, how does it work string to int use bitshift like '2' >> 0 -

i use bitshift want conver string bit, want know how work. "12345" >> 0 // int 12345 found '>>' deal 32-bit things , return int. confuse how work? according the specification , in "12345" >> 0 , happens: "12345" put through specification's abstract toint32 function : toint32 runs through tonumber coerce string standard javascript number (an ieee-754 double-precision binary floating-point value); ends being 12345 toint32 converts 32-bit integer value; ends being...12345 that 32-bit integer shifted...not @ because used >> 0 , still have 12345 and return int sort of. if stored result in variable, end being standard javascript number again (a double). spec seems allow possibility int value used as-is if combined operation others, though, makes sense. if goal force "12345" number using default coercion rules, >> 0 obscure , inefficient way (not latter matter). unary +

dart xml with external files -

i've been able follow examples of dart-xml dart file containing xml in variable. how parse , create external xml files? if try , import xml file directly dart gets stuck on first character of xml file '<'. how write given example dart-xml https://github.com/renggli/dart-xml ? can print shell using print(bookshelfxml.tostring()); but how save || pipe external file? i've tried use dart:io little not having success @ moment. this should want: import 'dart:io'; ... var file = new file('path/to/file.xml'); file.writeasstring(bookshelfxml.tostring()); see also: https://api.dartlang.org/stable/1.18.1/dart-io/file-class.html https://www.dartlang.org/dart-vm/dart-by-example https://www.dartlang.org/articles/dart-vm/io

c# - Func-eval on polymorphic classes -

i'm making managed .net debugger using mdbg sample. mdbg sample operates on top level class of given instance, not searching deep inside class hierarchy. able go through hierarchy , available methods. problem occurs in such case: public abstract class base{ public base() {someprop = "base"} public string someprop {get;set;} } public class : base{ public base() {someprop = "a"} public new string someprop {get;set;} } public static void main(){ var = new a(); var castedtobase = (base)a; //castedtobase.someprop -- expect result "base" when debugging } the problem when i'm getting castedtobase icordebugvalue , query it's icordebugvalue2::getexacttype class instead of base class. @ point cannot distinguish more method get_someprop invoke. expect icordebugvalue2::getexacttype take in consideration performed casts , not return underlying type. how can unders

sql - Calculate In Duration and Out Duration of Employee -

i have table named devicelogs_8_2016 in records of in-time , out-time record of employees stored. table name changes every month. ex: records 2016-09-01 0:00:00 saved in table named devicelogs_9_2016 table contains records of employees such below, need single userid on specified date . +--------+---------------------+-----------+ | userid | logdate | direction | +--------+---------------------+-----------+ | 7034 | 2016-08-08 08:21:14 | in | | 5012 | 2016-08-08 08:21:26 | out | | 7036 | 2016-08-08 08:21:34 | in | | 7034 | 2016-08-08 10:01:14 | in | | 8015 | 2016-08-08 10:10:39 | in | | 2055 | 2016-08-08 10:11:27 | in | | 209 | 2016-08-08 11:28:25 | out | | 209 | 2016-08-08 11:32:32 | in | | 11253 | 2016-08-08 12:35:17 | out | | 7034 | 2016-08-08 12:37:58 | in | | 7034 | 2016-08-08 13:30:13 | out | | 4586 | 2016-08-08 13:30:24 | in | | 7034 | 2016-08-08 13: