Wednesday, 15 September 2010

c# - AspNet Identity 2 Modifying table names -


I am trying to modify users' awesome and crazy table names from AspNETUsers.

My project is a webform website project I'm using Visual Studio 2012 , Entity Framework 6 and Framework 4.5 I have set up complete identity content, and everything is working properly .

Now I need to rename the tables I if I'm just puts the following code:

  protected override void OnModelCreating (DbModelbuilder modelBuilder) {base.OnModelCreating (ModelBuilder) ; // It needs to go before other rules! ModelBuilder.Entity & LT; IdentityUser & gt; () ToTable ("Users"). ModelBuilder.Entity & LT; IdentityRole & gt; () ToTable ("roles") .; ModelBuilder.Entity & LT; IdentityUserRole & gt; () ToTable ("UserRoles") .; ModelBuilder.Entity & LT; IdentityUserLogin & gt; () ToTable ("UserLogins") .; ModelBuilder.Entity & LT; IdentityUserClaim & gt; () ToTable ("UserClaims") .; } The ApplicationDbContext class in  

, it has not been executed, and if I try to change the table name manually, I get the error:

I invalid Aident name 'dbo.AspNetUsers'

after you follow a few tips I enable-migration account-migration and update-database try running the command, but I First of all there is an error:

  PM & gt; Able-migration -warboj  

startup project System.ArgumentException Using 'Mayprosennam intended NuGet project' MyProjectName 'use': The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

Server stack trace: EnvDTE.Properties.Item (object index) on SystemkRuntimekRemotingkMessagingkStackBuilderSinkk_PrivateProcessMessage (on IntPtr md, object [] args, object server, object [] & amp; outArgs) (iMessage message System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage)

exceptions rethrown [0]: System.Runtime.Remoting System on proxies. On EnvDTE.Properties.Item (object index) on Deta.antiti.amiageshn ReelProxy.HandleReturnMessage (IMessage reqMsg, IMessage retMsg) system. From time to time. Remoting.Proxies.RealProxy.PrivateInvoke (MessageData and msgData, Int32 type). Project Extension in System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade (String ConfiName, Boolean UserContactWorking Directory) in string contextTypeName (System Reference) on System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable Project Extensions .GetPropertyValue [T] (Project Project, String Properties Name).) On System.Data.Entity.Migrations.EnableMigrationsCommand. & Lt;> c__DisplayClass2 & LT; The parameter is not correct on .ctor> b__0 () System.Data.Entity.Migrations.MigrationsDomainCommand.Execute (Action command). (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

please give me some directions, because I do not know what to put where my hands now

< after div class = "text" itemprop = "text">

at issue:

EntityFramework is not complete

So the only way is to create a web application project and have all the existing code displaced.


python - TypeError in django when trying to create an upload form -


I am trying to follow the tutorial to create an upload form for my Django app. I am trying to create it, so I can upload a CSV file, then I can process it.

I'm not able to get a TypeError / upload / 'str' object

Upload HTML

   gt; & Lt; A href = "{{upload.csvfile.url}}" {{upload.csvfile.name}} & lt; / A & gt; & Lt; / Li & gt; {% Endfor%} & lt; / Ul & gt; {% Else%} & lt; P & gt; No uploads. & Lt; / P & gt; {% Endif%} & lt ;! - Upload form note antipay feature! - & gt; & Lt; Form action = "{% url 'upload'%}" method = "post" encrypt = "multipart / form-data" & gt; {% Csrf_token%} & lt; P & gt; {{Form.non_field_errors}} & lt; / P & gt; & Lt; P & gt; {{Form.csvfile.label_tag}} {{form.csvfile.help_text}} & lt; / P & gt; & Lt; P & gt; {{Form.csvfile.errors}} {{form.csvfile}} & lt; / P & gt; & Lt; P & gt; & Lt; Input type = "submit" value = "upload" / & gt; & Lt; / P & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

views.py

  DRF upload (request): # Upload request file if request.method == 'POST': form = UploadForm (request POST, request.FILES) form.is_valid (): newdoc = CSV (docfile = request.FILES ['csvfile']) newdoc.save () other: form = UploadForm () # blank, unbound form  < / Pre> 

models.py

  class CSV (models.model): file = models.FileField (upload_to = 'csv /')  

Forms.py

  class UploadForm (forms.Form): csvfile = forms.FileField (label = 'select a CSV file')  

Urls.py

  url (r '^ admin /', include (admin.site.urls)), url (r '^ upload / $', 'upload', name = ' Upload '),  

Any idea why I am getting this error? There is no way to find out what specifically is the debug page?

  Environment: Request method: Get Request URL: http://127.0.0.1:8000/upload/ Django Version: 1.7.6 Python Version: 3.4.2 installed application: ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',' django.contrib.sessions', 'django.contrib.messages',' django.contrib.staticfiles', 'import_export', 'fanduel') established middleware: ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware' "Djngokcontribkotkmidilveyrkothentikashnmiddlevre 'Djngokcontribkotkmidilveyrkseshnothentikashnmiddlevre' Djngokcontribkmessgeskmidilveyrkmessgemiddlevre 'Djngokmidilveyrkklikjakingkksframeopshansmiddlevre') Traceback: file "C: \ Users \ Wilson \ AppData \ Roaming \ Python \ Python34 \ site-packages \ django \ core \ handlers \ base.py" get_response 111. Response (request = wrapped_callback, * callback_args, ** callback_kwargs) exception type: / upload / exception TypeError: 'str' object is not callable  


html - background image rendering issue -


I have some problems with background on some mobile phones. <

Style for that div Is:

  #navpanel {background: url ('images / bg04.jpg'); Box-Shadow: Inset-1px 0px 0px 0px rgba (255,255,255,0.25), Inset -2px 0px 25px 0px rgba (0,0,0,0,5,5); Text-shadow: -1px -1px 1px RGBA (0,0,0,1); }  

It looks like a friend on iPhone 6 who looks like this:

And when it renders on my iPhone 5S the background image gets distorted:

Any idea why the background image will present this way? What does it have to do with the device's pixel density?

Sorry for the big images.

I have created a quick bella and it is rendered as desired

I do not understand why it looks different, because I believe that both devices have retina displays anyway, you can target retinal screens and You can use the media query to provide a high-res background image.

You currently have the image bg04.jpg 150x150, you need to find / create a high-RAV version.

  @ Media only screen and (-webkit-min-device-pixel-ratio: 2), screen only and (minimum-resolution: 1 9 2 dpi) {#navPanel {background-image : Url ('images/bg04@2x.jpg'); / * This image is 300x300 * / Background size: 150px must be 150px; }}  

Or try it in a hurry, but the pattern will look a bit different.

  @ Media only screen and (-bbkit-min-device-pixel-ratio: 2), screen only and (min-resolution: 1 9 2 dpi) {#navPanel {background-image : Url ('images / bg04.jpg'); / * Current 150x150 * / Background size: 75px 75px; / * Half *}}  

rodbc - Reading a access database (mdb) in 64 bit in R -


I have a database and I have to read that I found some packages in R such as Hmisc And RODBC which are functions to do this I am using windows and were not able to use HMIC because you need the mdb-tools package And I did not find any way to install mdb-tools on any tutorials or windows.

Now, I was trying to start with RODBC I got this question "" which shows how Windows has a connection I accepted the answer to that question Tried to use the same command as

  odbcDriverConnect ("driver = {Microsoft Access driver (* .mdb, * .accdb)}; dbQ = e: / projects \ newdata / 2013 Database / Data / PGDABBCW.MDB ")  

This returns the following error: < / P>

  1: in odbcDriverConnect ("driver = {Microsoft Access driver (* .mdb, * .accdb)}, DBQ = E: / Projects \ NewData / 2013 Database / Data / PGDABCISWMDB" ): [RODBC] Error: State 01S 00, Code 0, Message [Microsoft] [ODBC Driver Manager] Invalid Connection String Attribute 2: ODBC Driver Connect ("= {Microsoft Access Driver (* .mdb, * .accdb)}, DBQ = E: / Projects \ NewData / 2013 Database / Zeta / PGDBCISWMDB "): ODBC Connection Failure  

I'm not sure how it is being investigated here, to find out and start I went to administrative equipment and" data sources ODBC) "to check the options. enter image details here I changed the target to sysWOW

< P> Then I created a new data source as follows:

Enter the image here < / P>

I'm not sure whether I need to select a database or not. I found the RODBC tutorial of Brian Ripley, but still I am not able to work on it.

This works fine for me & amp; You can also work for:

  Required (RODBC) conn & lt; - odbcConnectAccess2007 (path.expand ("~ / Database.accdb") subset (sqlTables (conn), TABLE_TYPE == "table") df & lt; - sqlfetch (conn, "Table1") Close (conn)  

My sessionInfo () :

  #R version 3.1 .1 (2014-07-10) # Platform: x86_64-w64-mingw32 / x64 (64-bit) # # Other enclosed package: # [1] A namespace (and attachments) loaded by RODBC_1.3-10 # # No): # [1] ToolsAudio.1.1.1  

java - How to update an activitys background when it's set to the systems wallpaper? -


I have this code which allows me to set the current device wallpaper to be my activity background.

  Public Zero Wallpaper Background () (WallpaperManager WallpaperManager = WallpaperManager.Testinstance (this); Drawing WallpaperDrawable = Wallpaper Manager.getDrawable (see; View Root = Find VeeById (R.id.home_view); root.setBackground ( WallpaperDrawable);}  

The problem is, if I have to go through settings I do not update the wallpaper on my app and I have been left with the previous wallpaper how can I fix it?

It's really quite simple:

Just call your wallpaperBackground () in the method onResume () In your activity.

This will automatically apply the correct wallpaper when the user will restart the activity from another app.


git - What is a convenient way of writing a multiline commit message? -


Instead of writing a short, 40-character Git commit message, I would like to write a longer, multiparted message.

As I understand, I need to add a new line after the message 'title'. How can I enter a new line in OS X Terminal or Win 8 CMD?

You think () that

  git commit -m "  

is the only way to make a commitment. -M The flag describes this type of:

-M msg> , - Message =
given in the given message If the multiple -m options are given, their values ​​are added as separate paragraphs.

< / Blockquote>

This flag lets you commit Allows to write sh inline ; it is convenient for a short time (i.e. usually a one-line) commits the message, but not much time. For multi-line commit messages , You should leave the -m flag and just run

  git commit  

This will cause your editor to pop up To write and commit your commitments more convenient to you than the command line Allows to form.

I refer you to more details.


ios - UITableView loading Issues with images -


I have set up my application to use parse. I am uploading the image when the request is sent for parsing So it stores all of my objects in an array 'wallObjectsArray', although images are the problems they display when I see them in their UITableview. It was initially shown that by then nothing will disappear until I refresh UITableView. I used SDWebImage before but I did not think I would need it with it because all the images have already been stored in my array, I just want to display them and easily scroll through the UITableView Want to do I am using a custom class class in my code below

  self.customCell = [tableView dequeueReusableCellWithIdentifier: @ "cell"]; PFObject * wallObject = [self.wallObjectsArray objectAtIndex: indexPath.row]; _image = (PFFile *) [wallObject objectForKey: @ "image"]; Self.customcell.profileImageView.image = [UIImage imageWithData: _image.getData];  


ruby - Rspec raise_error within context doesn't seem to work -


wrote me this, and passed it.

  This raises a GitConfigNotFound error when the YAML config file can not be found 'Permitted (YAML). To get (: load_file) .with (Rails.root.join ('config', 'git_config.yml')) .and_raise (Errno :: ENOENT) Expected {described_class :: config}. Raise_error GitConfigNotFound End  

Then I put it in context to match my other tests and it failed. Formatted as shown below, does anyone have such insight that why is this happening?

  Reference 'A GitConfigNotFound will increase exceptions if the git config file is missing' before permitting (YAML). To obtain (: load_file) .with (Rails.root.join ('config', 'Git_config.yml')) .and_raise (Errno :: ENOENT) to end {{(described_class :: config.) Raise_error GitConfigNotFound}  

This is giving me this output, which I think it seems, but does not hold it for any reason:

  1) GitConfigsLoader will take exception to a GitConfigNotFound if the git config file is unavailable / error: it's {hope (description_class :: config). Raise_error} GitConfigNotFound: Error: git_config.yml not found. # ./lib/git_configs_loader.rb:9: 'Defend in Conflict' # ./lib/git_configs_loader.rb:7:in 'config' # ./spec/lib/git_configs_loader_spec.rb37:in` In Block (Level 3) & Lt; Top (required) & gt; 'Maybe this is what was meant by Peter Alfwin, but in the end I answered the answer in response to each other. I was using  expected {...}  instead of  expected (...) . Parents execute instantly and instantly kill and are not caught by  .to raise_exception . Executes the block to use the braces and allows  raise_error  to capture the error. 

  Reference 'When a git_config.yml file is not active' first allow ('YAML). To get (: load_file) .and_ridge (Errno :: ENOENT) it will end {hopefully {description_clash :: configuration}. Raise_exception GitConfigNotFound} Termination  

How to implement custom gallery in Android with half images being displayed on right and left end and a full image in the middle? -


छवि दर्ज करें यहाँ विवरण

कृपया गैलरी को कार्यान्वित करने में मेरी मदद करें जैसे कि चित्र संलग्न है। मैं चाहता हूं कि छवियों को क्लिक करने योग्य और बाएं-दाएं स्वाइप करें, बाएं और दाएं में नई छवियाँ इसी प्रकार की कॉन्फ़िगरेशन करें दाएं स्वाइप पर पूर्ण छवि आती है और आधे सही छवि के स्थान पर आती है, बायां आधा छवि पूर्ण मध्य चित्र में जुड़ी होती है और बाईं ओर से एक नई छवि आती है और बायां आधा छवि पर स्थिर होती है।

इस प्राप्त करने के लिए यह आपको नीचे दिए गए चरणों का पालन करने की ज़रूरत है 1. गैलरी बनाएं 2. छवि एडाप्टर बनाएं 3. गैलरी की चौड़ाई और एडेप्टर की दृश्य (छवि दृश्य) के अनुसार अपनी आवश्यकता के अनुसार सेट करें।

यदि आप कुछ सरल दृश्य चाहते हैं तो कृपया नीचे दिए गए लिंक का पालन करें:

मुझे आशा है, यह आपके लिए मदद करेगा।


mysql - Best way to update over 12 million record Loop or no loop -


I have more than 12 million records in my table with more than 6000 stock figures for the past 15 years. I << html>

Trying to update please see the sample table below. The only way I can think of updating the price of tomorrow is using the script language. I am using C # to loop through all the records. The first loop is to get all the symbols, the second loop through each symbol from the first loop, and update the price of tomorrow one day before tomorrow. It takes a very long time any ideas, new approaches, and other approaches that speed up the process?

  symbol, today, value, price of tomorrow ---- --------- ----- - ------ AAPL, 5/13 / 2015, 123.59, 124.45 Apple, 5/12/2015, 124.45, 122.24 Apple, 5/11/2015, 122.24, Apple does not know, 5/10/2015, 127.41, do not know  
< / Div>

You update this single SQL statement, like this:

  Update MyTableT Join Left Outter MyTable y on y.Symbol = t.Symbol and t.todayis = subdate (y.todayis, 1) SET a.yesterdayprice = COALESCE (y.price, 'do not know')  

This attempts to execute a self-contained UPDATE , symbols And computing via yesterday's date subdate (y.todayis, 1) ( t means "today", y < / Code> for "tomorrow").

When the associated row is found, COALESCE provides value for updates from when the row is not there, then 'unknown' string Is used as the default.


iOS8/Swift: UICollectionViewCell height calculation -


From other posts about this subject, I tried the following approach - but in some way "fu" as well as " Bar "may be

  func collectionView (see archive: UICollectionView, Layout ViewViewLayout: UICollectionViewFlowLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) - & gt; CGSize {var foo = collectionView.cellForItemAtIndexPath (indexpath) as? MessageCell var bar = foo? .messagetext.frame.height Return to Class:  
  

CustomSheet: Code> Call the class message: UICollectionViewCell, Delegate the UIPopover Presentation Controller, UITextViewDelegate {@Iboutlet weak var AuthorLabel: UILBL! @IBOutlet Weak World Timestamp Label: UILball! @ IBOutlet weak var message text: UITextView! Func setCell (authorLabelText: string, message text: string, timestamp label text: string) {self.authorLabel? .text = authorLabelText self.timestampLabel? .text = timestampLabelText self message text? .text = messageText self.messageText.delegate = self.messageText .sizeToFit () // works, when I have a custom color background printline (auto-message.text.frame.hete)}}

I am giving a different heights to my custom cell orbit? There will be no such reason because it has not been sung yet, right?

€ dit: A screenshot from the stop at "foo": Enter image details here

bar is because Foo is zero - this is the option that "? " is doing in that expression if as the collection View.cellForItemAtIndexPath (indexPath)? The message is , which means either:

  • There is no cell on that index path, or
  • There is not an example of a MessageCell

on cell indexPath , I suggest that more likely to be later That's because those representative messages are actually 'called by an illegal index route where you register your cell class (in code or in the storyboard), are you sure However, are they MessageCell Registration as sales? <

403 Forbidden on PHPMyAdmin in Puppy Linux -


I have installed XAMPP in Tahtpepe. I need this for a class, but there is only one which runs Linux I can not get help from others in class or trainer.

I am getting a 403 forbidden error 127.0.0.1/phpmyadmin / and localhost / phpmyadmin or accessing Even just trying to reach 127.0.0.1 and localhost .

Version: XAMPP for Linux 5.6.3-0

I detected that Apache and MySQL and stuff have started ( xampp start running Used to be) .

Based on the other answers httpd-xampp.conf under & lt; LocationMatch ... to say

  Deny order, Allow all to allow: 1 127.0.0.0/8 Allow all  

and in httpd.conf

   

... it was already a configuration, and most answers asked to change it - this, which was already there.

I need to be able to post config files. I just do not know where to start from now.

As mentioned here: lines

  order permissions Give, deny permission to everyone  

is required to be deleted.


Docker - Disk Quotas -


I think the docking containers have a maximum of 10 GB disk space with the device mapper storage driver as per the default.

In my case, I have a worker container and a data volume container. Then I link them together using "-wholes-in" I also use the device mapper storage driver.

For example, I did a test by creating a script to download a 20GB file on my data volume container and it worked successfully.

My question, is there a 10 GB quota for data volume container? If 20 GB files have been downloaded successfully, then it is limited to 10 GB?

The version of the union file is out of the system according to the definition, so any data from them is devicemapper 10GB limit And will not be counted. If you do not specify the mount point, the default editions are stored under / var / lib / docker / vfs .

You can find exactly where your volume is on the host by observing the dockers as the command:

  Docker inspection -f {{. VOLUES}} Container  

will result in you:

  map [/ container / volume: / var / lib / docker / vfs / dir / 5a6f7b306b96af38723fc4d31def1cc515a0d75c785f3462482f60b730533b1a]  

Where the path is the location of the volume on the colon host.


locking - Exclusive file lock on windows, slowness -


I am trying to use unique file locking as a lock between processes running on a different host. Most of the time it works fine either it succeeds or returns ERROR_SHARING_VIOLATION in a loop I do:

  CreateFileW (name, FILE_APPEND_DATA, FILE_SHARE_DELETE, zero, OPEN_ALWAYS, // open or create FILE_FLAG_DELETE_ON_CLOSE, // pass the file at zero);  

From time to time, this return ERROR_ACCESS_DENIED but again successful

issue. On rare occasions: Launching Process Stacks on opening the file: Let's succeed, but the rest say (20 processes) locked file for some important amount (50 minutes) is showing and its timeline has updated. .

Then a process was found, and after some time, all the reminder processes successfully (like a few seconds) relatively short time

then 2 questions

  1. How to fix such behavior
  2. Minor questions? Why returned ERROR_ACCESS_DENIED <. / Li>

thanks

environment:

  • File R2 on Windows Server
  • Program R2 Protocols on Windows 2008
  • SMB 2.1

ACCESS_DENIED probability is:

If you call CreateFile on a file that has a pending deletion as a result of a previous call to DeleteFile, fails on the functionality, delaying the operating system until the file is deleted Till all the handles in the file are not closed Ati. GetLastError returns ERROR_ACCESS_DENIED.

You do not have the DeleteFile phone, but you do an equivalent job.

You did not quite say what was the undesirable part of the behavior. You see that I feel stuck - in which case I advise you to try to add the FILE_COMPLETE_IF_OPLOCKED flag.

One more thing that can be influenced by you is that it is a tunnel and remove it - look at it. So disable the tunnel and see what it brings to you.

To further diagnose, you want to run a propon trace on both the affected clients and servers, which are the affected SMB shares.


vb.net - Access violation exception in Visual Basic 2010 using CUDA as backend DLL -


I have a Visual Basic 2010 front end, which calls a Visual C ++ DLL. The Visual C ++ DLL contains calls to the CUDA kernel. This is a video compression application.

The Visual C ++ app creates frames for each video frames are stored in files whenever I run the Cuda App directly without the VB front end, Produces But when Visual Basic CUDA calls the app main () . Files are created but after some 1700 files, the VB program throws an exception with the error

  AccessViolationException: You tried to read / write secure memory  


php - Convert date format in SQL -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 17 उत्तरों

मेरे पास तिथियों की एक स्ट्रिंग है Php ( dd / mm / yyyy ) में जिसे मैं yyyy-mm-dd प्रारूप में कनवर्ट करना चाहता हूं।

मैंने कोशिश की है:

<पूर्व> UPDATE `तालिका` SET` DATE_VAR` = कनवर्ट करें (दिनांक समय, '19 / 03/2015 ', 121) जहां `आईडी` = 160

क्या आप मदद कर सकते हैं मुझे <

यदि आप PHP में दिनांक रूपांतरण करना चाहते हैं उसके बाद एक समाधान हो सकता है:

  $ originalDate = str_replace ('/', '-', "19/03/2015"); $ NewDate = तिथि ("वाई-एम-डी", स्ट्रॉटोम ($ मूल दिनांक)); // यह आपकी mysql संगत तारीख है ...  

आप क्वेरी में $ newDate चर का उपयोग कर सकते हैं।

  UPDATE ` तालिका `सेट 'DATE_VAR` =' $ नयाडेट 'कहां` आईडी` = 160  

javascript - Highcharts chart not displaying data from csv file -


I am working on a project that CSV data is being written in real time and it will be sent to an html The page is displayed I am using Javascript, and JQuery, HighCharts, and PapaParse libraries.

This is my JSFiddle my code:

I know that this does not look right, but I do not know how to show it as it looks on my computer. Should I Use a Different Hosting Site?

When I hardcoded the dummy data in the chart like this:

  // altitude $ (function () {$ ('# altGraph'). HighChurch ({ Chart: {Type: 'line'}, title: {text: 'payload altitude'}, subtitle: {text: 'height (m) versus time (time)}}, xAxis: {categories: [' 0 ',' 1, '2', '3', '4', '5', '6', '7', '8', '9']}, yAxis: {title: {text: 'altitude (m) '}}, Plot option: {line: {dataLabels: {enabled: true}, enable mouse tracking: wrong}}, series: [{name:' height ', data: // dummy data here}}}});  

All this works and looks good but When I use the papper to parse the CSV in the data arrays, and pass an array of data in a similar chart:

  // Altitude $ (function ( } {Title: {$ ('# column (' chart: {type: 'line'}, title: {text: 'payload altitude'}, subtitles: {text: 'height (vs) time (time)}}, xAxis: {Categories: ['0', '1', '2', '3', '4 ', 5', 6 ', 7', 8 ', 9' 1/2 '], yAxis: {title : {Text: 'altitude (m)'}}, plot option: {line: {dataLabels: {enabled: true}, enableMouseTracking: false}}, series: [{name: 'height', data: height}]} ); });  

The charts appear blank.

Despite the data scan being empty, on your computer, the charts appear when selecting a file. This is my problem. I was thinking that after writing the chart on the page before uploading the data, that would be why the data is not showing. I am currently at a disadvantage how it is decided.

The problem is that your parents change the strings in the array rather than values. Look for "dynamic typing" parameters and then set it as true.


c++ - pthread how to create many threads -


एक थ्रेड बनाने के लिए, मैंने ऐसा किया:

  शून्य * दिनचर्या (शून्य * I) {....} pthread_t thread1; Pthread_create (और थ्रेड 1, नल, रूटीन, नल);  

अब मैं 100 धागे बनाना चाहता हूं और उन सभी को रूटीन निष्पादित करना है, क्या मुझे नीचे की तरह करना है? क्या लूप का उपयोग करना संभव है?

  pthread_t thread1; Pthread_t थ्रेड 2; ... pthread_t thread100; Pthread_create (और थ्रेड 1, नल, रूटीन, नल); Pthread_create (और थ्रेड 2, नल, रूटीन, नल); .... pthread_create (& amp; थ्रेड100, नाउल, रूटीन, नल);  

आप धागे की एक सरणी बना सकते हैं

  # परिभाषित NTHREADS 100 pthread_t वें [NTHREADS]; Int i; के लिए (i = 0; i & lt; NTHREADS; ++ मैं) pthread_create (और [i], ...);  

image - network.request invalid URL in Corona SDK -


I am working with Google developer resources to download images in my Coron SDK app.

As long as the URL is given, I am able to download the image. However, when I make the image ID a variable, I get the following error:

Invalid parameter: URL logic random url

This URL works:

  imgRequest = "https://drive.google.com/uc?export=download&id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx"  

This URL is not:

< Pre> imgID = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" imgRequest = "https://drive.google.com/uc?export=download&id="..imgID

download it I use it:

  network.download (imgRequest, "GET", imgListener, "pic.png", system.Documents Directory)  

When i Print out the frustration comes both convergent URL and which has already been put together, and I get the same results would suggest to anyone to do next attempt?

Thanks in advance

I think there can be something else on the play; Can you provide the least work examples that display this issue?

I have tried both the URLs and I have not found any error on either of them. I am testing in Windows simulator using Corona Daily Build v2015.2576.


html - Blur only text inside input, not whole <input> element -


For various reasons I graphically Blurred type = text Input, not the entire element.

Is there any way to do this?

I currently have this:
HTML

  & lt; Label & gt; Text & lt; / Label & gt; & Lt; Span class = "verification limit" & gt; & Lt; Input class = "verification" type = "text" & gt; & Lt; / Input & gt; & Lt; / Span & gt; & Lt; Label & gt; Some text & lt; / Labels & gt; & Lt; Input & gt; & Lt; / Input & gt;  

and css

 . Validation: not (: Focus) {-webkit-filter: blur (3px); Filter: Blurred (3px); Border: 0; }. Validity Limit (range: 1px black solid; z-index: 20;}  

Previous style style definition to change the input range with the word verification

But this is far from right.

  1. The boundary 'perimeter' is not the same dimension
  2. If I increase the size of the outer boundary , I still get some blurred leak

example and mega limit example Leakage

Is there a better way to just text Thumb, and not a bounding box? Or some other methods of covering side effects to obscure the input element

< P> Instead of making the whole box effective, we simply make the font color transparent and add a text shadow effect.

Blur-on-to-Focus: No (Focus) { Color: transparent; text-shadow: 0 0 5 px rgba (0,0,0,0,5.5);}

It is detailed.

< / Html>

ios - Get the current color of the status bar -


Is the current color of the status bar possible in iOS? I know that we can change the color, but is it possible to present the status of the programmatic status bar? Such as its UIStatusBarStyleLightContent or UIStatusBarStyleDefault

You can get it this way:

  Uitatus Barstyle Current Style = [UIApplication Sharing]]. Stats Bars Style;  

sql - SSRS 2008 Add value to parameter resultset -


We have implemented a new system-only read-only feature for the database Writing reports for current and historical data Using the drill through the report to display the number of places and people, calculate the location and go to the details.

I query the location table to populate the parameter values. It works properly

What I want is to add "pre-implementation" to the parameter result, which exists from the tap, because the data was before the date of implementation. The phrase needs to appear in the drop-down list of locations so that users can choose it. The above mentioned phrase needs to appear on the report. How would you do this?

Whatever I have tried: ask questions which give "pre-implementation", as well as active location for time period. SSRS will not display as a substitute in a drill through the report.


R: applying a function on whole dataset to find points within a circle -


I have a problem in the application of data frames on my function. In it, three column IDs of one point, on the x-axis Its location and its location on the Y axis, I have to do just that I will have to find the given point id of the points given in the neighboring area. I have shown the function which states that the point is located within a circle where the center is the location of a point and if it is true, then it returns the ID.

Here's my code:

  point_id  

Many thanks for your advice!

You can deal with this with R district with the function:

  # set random seed and some dummy data set.seed (101) Create dummy & lt; - data.frame (ID = 1: 100, x = Ranif (100), y = Rinif (100)) gt; head (Dummy) ID xy 1 1 0,37219838 012501937 2 2 0,04382482 0,02332669 3 3 0, 70968402 0,39186128 4 4 0,65769040 0,85959857 5 5 0,24985572 0,71833452 6 6 0,30005483 0,33939503   dist  

Call> function which A dist object returns the default distance metric that you have code in your question is euclidean

  dists & lt; - District (Dummy [, 2: 3]).  

Returns the index for each ID that is more loop than the distance matrix and that is within some constant distance:

  neighbors & lt; - Applicable (as.matrix (dists), 1, function (x) which (x <0.33)) gt; Neighbors [1]] 1 6 7 8 1 9 23 30 32 33 34 42 44 46 51 55 87 88 91 94 99  

Here is an amendment to handle the unstable ID: < / P>

  set.seed (101) dummy & lt; - data.frame (id = sample (1: 100, 100), x = runoff (100), y = reinforced (100)) gt; Head (dummy) ID xy 1 38 0.12501937 0.60567568 2 5 0.02332669 0.56259740 3 70 0.39186128 0.27685556 4 64 0.85959857 0.22614243 5 24 0.71833452 0.98355758 6 29 0.33939503 0.09838715 Dists (Dimi [2: 3]) neighbors & lt; - Applicable (As.matrix (dists), 1, function (x) {dummy $ id [which (x <- 0.33)} name (neighbors) <- dummy $ id & gt; neighbors [['' ']] [1] 38 5 55 80 63 76 17 71 47 11 88 13 41 21 36 31 73 61 99 59 39 89 94 12 18 3  

Draw a complex circle (Has border only on the left half of it) using Android Shapes -


I am trying to attract a complex circle from the other half using the XML description of Android . / P>

There is a limit on the left side of the last circle and there should be no limit on the right side.

Although I am creating two separate boards (with one border, without the other) and merging them but I did not manage to do so?

first_circle.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Size Android: shape = "oval" xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Solid Android: Color = "@Android: Color / Holo_Ard_Darar" /> & Lt; / Size & gt;  

second_circle.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Size Android: shape = "oval" xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Solid Android: Color = "@Android: Color / Black" /> & Lt; Stroke Android: width = "6dp" Android: color = "@ color / lectra_black" /> & Lt; / Size & gt;  

final_circle.xml

  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Layer-list xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Item android: top = "0dp" Android: left = "0dp" Android: Below = "0dp" Android: right = "0dp" Android: drawable = "@ drawable / first_circle" & gt; & Lt; / Item & gt; & Lt; Item android: top = "0dp" Android: left = "0dp" Android: bottom = "0dp" Android: right = "0dp" Android: drawable = "@ drawable / second_circle" & gt; & Lt; / Item & gt; & Lt; / Layer-list & gt; I am answering my question: half a circle with the counter, without the other half  

Circle_grey in drawable XML, counter-black XML, counter-black_clip.axm

Layout contains activity_main.xml.

circle_grey.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Size Android: shape = "oval" xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Solid Android: Color = "#A0A0A0" /> & Lt; / Size & gt;  

counter_black.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Size Android: shape = "oval" xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Size Android: width = "80sp" Android: height = "80dp" /> & Lt; Stroke Android: width = "4dp" Android: color = "# 000000" /> & Lt; / Size & gt;  

counter_black_clip.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Clip xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Dragon = "@ Drawable / Counter-Black" Android: Clip Orientation = "Horizontal" Android: gravity = "left" / & Gt;  

activity_main.xml

  & lt; Relative layout xmlns: android = "http://schemas.android.com/apk/ res/Android" xmlns: tool = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" tool: Reference = "MainActivity">. & Lt; LinearLayout Android: layout_width = "80dp" Android: layout_height = "80dp" Android: Background = "@ drawable / circle_grey" Android: Orientation = "Horizontal" Android: layout_marginTop = "10dp" Android: layout_marginBottom = "10dp" Android: Layout_marginRight = "10dp" Android: layout_margin lift = "10dp" & gt; & Lt; Android: background = "@ drawable / counter_black_clip" Android: layout = "match_parent" Android: layout_height = "match_parent" Android: id = "@ + id / layout_half_cercle" Android: weightSum = "7" Android: Background = "Horizontal" /> & Lt; / LinearLayout & gt; & Lt; / RelativeLayout & gt;  

activity_main.java

  package app.test.com.myapplication; Import android.graphics.drawable.ClipDrawable; Import android.support.v7.app.ActionBarActivity; Importroid.os.Bundle; Import android.widget.LinearLayout; Public Squared MainActivity ActionBarActivity {@Override Protected Zero OnCreate (bundled savedInstanceState) {super.onCreate (savedInstanceState) extends; SetContentView (R.layout.activity_main); LinearLayout layoutDate = (LinearLayout) FindById (R.id.layout_half_cercle); Clip drawable drawable = (clip dual) layout data. Getbackground (); Drawable.setLevel (drawable.getLevel (+5000); }}  

javascript - Jquery hover event stuck on clone elements -


I am creating a plugin with portfolio for portfolio items. Everything works fine but the problem is that when I apply the filter, the hover effect has stopped working on cloned items

jquery code is given below I tried

  / * scroll up button * / jQuery (document) .ready (function () {// anime box shadow add some over / overlay on elements. We do not need it in HTML so we make it here Closed Plugin var $ portfolioClone = jQuery ("Rudra-Portfolio") Clone (true); // Click on each click event handler jQuery (click on ". Rudra-portfolio-filter") (function (e) {jQuery ("Rudra-portfolio-filter took"). Get the class attribute value of the ClickClass ("current") // link clicked var $ filterClass = jQuery (this) .Parent (). Attr ("class"); if ($ filterClass == "all") { Var $ filteredPortfolio = $ portfolioClone.find ("li");} and {var $ filteredPortfolio = $ portfolioClone.find ("li [d] at-type ~ =" + $ filter class + "]");} // Call druid jQuery ("ul.rudra-port Folio "). Quicksand ($ filtered portfolio, {duration: 500, easy: 'camerainautuqua'}); JQuery (this) .parent () addClass ("current"). // Stop the browser jumping for link anchor e.preventDefault (); }) JQuery ("Port-Lee"). Click (function () {jQuery (this) .Find ('content-wrapper') slidedown ();}); JQuery ("Overeffect"). Mouseover (function () {jQuery (this) .find ('content-wrapper'). Slidedown ();}); JQuery ("#Portfolio-Grid Li") Mouseleave (function () {jQuery ('content-wrapper'). SlideUp (500);}); });  

Hour effect is working fine for the first and second times, but after that, it stopped working.

Update

I also tried

regex - Multiple Line Search in Notepad++ -


I am looking for a way to identify missing records within a record group in Notepad ++. Each record group starts with Tild and ends. However, some group expansion records (H1 records) are lost. In the example below, I need to find bold / italicized entries.

~ H1 ~, 10222,30333, Jones
Midwest Emergency, 123456


H1 ~, 30334, 3234543, Smith
Midwest Emergency, 933233


Midwest Emergency, 92345434


H1 ~, 3232353434,232343534, Horst
Midwest Emergency, 223342545


Modern Emergency, 2334333



H1 ~, 3055543,33232322, Vice
South Emergency , 233446655

Something like this should be done:

  

here Please use:

The next time you post your efforts


php - Laravel migration - change column structure -


My img is in my news table and I want to structure To change it is currently set to varchar (200) and I want to be text .

How can I get it?

You have to drop the column and recreate it or db :: statement To change the table and manually write the query, I remember that the way to change column values ​​from Laravel is not available.


AngularJS ui-utils password validation -


I have a problem with angular ui-utils, especially UI-validate I have a user with password change form I am trying to provide and match is required to "new password" and "confirm new password", here:

  & lt; Table class = "table" & gt; & Lt; Form & gt; {{Password password.New password 2. $ error.validator}} & lt; Tr & gt; & Lt; Th & gt; Current password: & lt; / Th & gt; & Lt; Td> & Lt; Input type = "text" name = "current password" ng-model = "passwordform content password" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Th & gt; New Password: & lt; / Th & gt; & Lt; Td> & Lt; Input type = "password" name = "new password" ng-model = "passwordForm.newPassword" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Th & gt; Confirm new password: & lt; / Th & gt; & Lt; Td> Input  Save     & gt;  

and in my controller I have

  $ scope.passwordForm = {current password: "", new password: " "New Password 2:" "};  

The problem is, it does not matter if the newpassword and newPassword2 match, save The button button is enabled and evaluates for {{!! passwordForm.newPassword2.error.validator}} incorrect

I have previously Many have gone through Stackoverflow threads and other sources, but I can not understand what any help is wrong in my code.

  angular module ("plunker", [ 'Ui.utils']);  

Then there are some problems with HTML that you have posted, firstly, do not have your form inside a table. Stade and it is not valid, so I moved it out of the table and I create a name

  & lt; Form name = "myForm" & gt; & Lt; Table class = "table" & gt; {{!! !! MyForm.newPassword2. $ Error.validator}} & lt; Tr & gt; & Lt; Th & gt; Current password: & lt; / Th & gt; & Lt; TD & gt; & Lt; Input type = "text" name = "currentPassword" ng-model = "passwordfirm content password" & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Th & gt; New Password: & lt; / Th & gt; & Lt; TD & gt; & Lt; Input type = "password" name = "newpassword" ng-required = "true" ng-model = "passwordfirm.newpassword" & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Th & gt; Confirm new password: & lt; / Th & gt; & Lt; TD & gt; & Lt; Input type = "password" name = "newPassword2" ng-required = "true" ng-model = "passwordForm.newPassword2" ui-valid = "'$ value == passwordForm.NewPassword'" ui-validate-watch = " 'Password Form.New Password' "& gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Button type = "button" ng-click = "send change password ()" ng-disabled = "myForm.newPassword2.over $ Error.validator" class = "btn btn-primary" & gt; Save & lt; / Button & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt;  

I have also added ng-required for two new password fields because the empty form will not be allowed to allow the password and in the end your button will be the name of the actual form instead of the ng-disabled feature To find your object validator.

It should fix this, I have a working example


sql - First LSN and last LSN the same in transaction log backups -


While restoring SQL server transaction log files, I have noticed that many nights have been backed up, with the first and The last version is LSN.

Do these files have to be reinstated as part of a series or can they be dropped?

Spring best practice to separate model from view in controller and jsp? -


स्प्रिंग कंट्रोलर वर्ग (@ @ मॉडलअटिबिट के साथ)

मजबूत>) और एक ही समय में मॉडल तैयार करने के लिए jsp या मॉडल को वसंत और jsp < / em> ? विचार इस से आता है मेरे पास एक नियंत्रक वर्ग है: @RequestMapping (मान = {"", "/"}, विधि = RequestMethod.GET, params = "mode = create") सार्वजनिक मॉडल और दृश्य शोकेआरपेज (@ModelAttribute ("CreateForm") ApplicationCreateForm प्रपत्र) {रिटर्न customMethod ("कुछ स्ट्रिंग"); }

और मेरे जेएसपी में मेरे पास है:

  & lt; jsp: useBean id = "createForm" scope = "request" class = "com.example .ApplicationCreateForm "/ & gt;  

मुझे उपयोगकर्ता को उपस्थित होने के लिए जानकारी के साथ फार्म भरने की ज़रूरत नहीं है।

इसलिए जो मैं uderstand से घोषणा की गई है, ApplicationCreateForm एक ही गुंजाइश के साथ दो बार बीन - अनुरोध।

क्या यह एक ही समय में दोनों का उपयोग करने के लिए एक अच्छा डिजाइन अभ्यास है? क्या इसका कोई कारण है? क्या दूसरा घोषणा (jsp में) मुझे अधिक शक्ति देता है, उदाहरण के लिए मॉडल को ओवरराइड करना है या यह अनावश्यक है? क्या दूसरा घोषणा पहले से एक को ओवरराइड करता है जब दोनों मौजूद हैं?

इस कार्यान्वयन में कई चीजें गलत हैं ।

क्या यह एमवीसी है?

अगर जेएसपी मॉडल के बारे में जानता है, हमें नियंत्रक की आवश्यकता क्यों है? चलने वाले इंजन को हटाने और मॉडल का उपभोग करने के लिए जेएसपी का उपयोग करें। लेकिन फिर आवेदन अखंड होगा। मेरा मानना ​​है कि आप ऐसा नहीं चाहते हैं हमारे पास एमवीसी के दो प्रमुख स्वाद हैं I दोनों में, नियंत्रक सामने वाले ऑब्जेक्ट है। यह आदेश प्राप्त करता है, इसे व्याख्या करता है, डेटा परत के साथ काम करता है और मॉडल हो जाता है। यदि आवश्यक हो तो मॉडल को एक दृश्यमॉडल में परिवर्तित कर दिया जाता है और फिर इस ऑब्जेक्ट को देखने के लिए पारित किया जाता है।

क्यों देखें मॉडल?

हम स्क्रीन पर पेजिंग को लागू कर रहे हैं कहें। हम व्यक्तियों की सूची दिखा रहे हैं व्यक्ति आपका मॉडल यहां है लेकिन आपके दृश्य को पृष्ठ संख्या, पेज आकार आदि भी जानना चाहिए। इस प्रकार इस मॉडल में सीधे तौर पर इस मामले में फिट नहीं हो सकता है।

कहें कि स्क्रीन पर दिखाए जाने के लिए हमें कई तालिकाओं से डेटा की आवश्यकता है। यह डेटा किसी तरह से संबंधित है अब आप अलग-अलग मॉडल ऑब्जेक्ट्स को देखने और इसे सभी व्यापारिक तर्कों को करने की अनुमति देंगे? आदर्श रूप से नहीं।

डिजाइन को डीटीओ या व्यूमोडाल या कमांड और प्रश्नों का समर्थन नहीं करना चाहिए?

हम चाहते हैं कि हमारा आवेदन ठीक से तैयार हो। जैसा कि ऊपर बताया गया है, हमें प्रसंस्करण के बाद डेटा देखने या ग्राहकों (आरईएसटी) भेजने की जरूरत है। जब तक हम सिर्फ एक सीआरयूडी सामान नहीं बना रहे हैं तब तक प्रसंस्कृत डेटा आपको डोमेन तक नहीं मैप कर सकता है। क्या होगा अगर आप सीक्यूएस या सीक्यूआरएस को लागू करना चाहते हैं?

अलगाव कहां है, जहां ठोस है?

अगर मेरा विचार व्यापार तर्क तो चल रहा है तो 'एस' कहां है? अगर मॉडल को मॉडल के बारे में पता है और मॉडल में कुछ बदलावों में बदलाव की आवश्यकता है तो 'ओ' कहां है? क्या होगा अगर मैं कमांड (सीक्यूएस) से प्रश्नों को अलग करना चाहता हूं और दो चीजों को अलग से स्केल करना चाहता हूं?

निष्कर्ष निकालना मैं कहूंगा, हां आप ऐसा कर सकते हैं लेकिन यह अच्छा नहीं है यदि आप सभ्य आकार के आवेदन को विकसित कर रहे हैं या आपको लगता है कि यह अंततः एक होगा। मैंने लोगों को ORM से शुरू की जाने वाली मॉडल संस्थाओं का उपयोग करने के लिए नियंत्रक को देखा है। यह काम करेगा लेकिन सवाल यह है कि आप एक अखंड और कसकर युग्मित आवेदन चाहते हैं। मेरे अनुभव के मुताबिक प्रस्तुति तर्क (दृश्य) में नियंत्रक की तुलना में डेटा की बहुत ही भिन्न तर्क और आवश्यकता होती है और वही आपके डेटा एक्सेस परत के लिए चला जाता है।


How to subset data using non-numerical criteria in r? -


नमस्ते मेरे पास डेटा का एक सेट है जो इस तरह दिखता है:

  cond image name stim Resp con imgrey num 1 anim mamm fd 1 1 0.025 163.75 73 2 एनिमेशन mamm fd 1 1 0.025 130.50 154 3 एन्निमम एफएम 1 1 0.025 164.75 9 4 एनिम पोव एफडी 1 1 0.025 186.25 202 5 एनीम पाओ एफडी 1 1 0.025 181.50 178 < / कोड>  

सिवाय इसके कि कुल में 3360 पंक्तियाँ हैं, मुझे एक नई डेटा फाइल बनाना होगा, जो पंक्तियों को दिखाती है जिसमें छवि "पाउ" है, मैं इसके लिए काफी नया हूं और यह समझने में संघर्ष कर रहा हूं कैसे रखने के लिए एक मापदंड के रूप में "पाउ" के साथ अपने डेटा को सबसे कम करना मैंने कोशिश की है

  newdata & lt; - सबसेट (mydata, image == pow, select = c (cond, name, stim, resp, con, imgrey, num)) mysample & lt; - Mydata [नमूना (1: ncol (mydata), mamm, replace = f),]  

लेकिन जैसा कि मैंने कहा कि मैं आर का उपयोग करने के लिए नया हूँ, कोई मदद काफी होगी की सराहना की!

  df cond छवि नाम stim con imgrey num 1 anim mamm fd 1 0.025 163.75 73 2 anim Mamm fd 1 0.025 130.50 154 3 एन्निमम एफएम 1 0.025 164.75 9 4 एनीम पाउ एफडी 1 0.025 186.25 202 5 एनीम पाउ एफडी 1 0.025 181.50 178 डीएफ 1 & lt; -df [! (डीएफ $ इमेज! == "पाउ"),] डीएफ 1 Cond छवि नाम stim con imgrey num 4 anim pow fd 1 0.025 186.25 202 5 एनिम पॉव एफडी 1 0.025 181.50 178  

क्या यह आप के लिए देख रहे थे?


how to use begin transaction for multiple queries and different tables (sqlite3, python) -


I am using the following code to insert data into 2 tables:

  1. Variation
  2. # bgn transaction cur.execute ("start") id_var = 0 for prop_redirect ["result"] ["bines"]: Var_res = red ["x"] ["value"]. Partition ('/') [- 1] var_type = "t1" #inert data table VARIATIONS cur.execute ("INSERT INVERATIONS VALUES (ID, NAME, TYPE)", (Str (id_var) + Data entry VAR_ENTITY cur.execute ("VAR_ENTITY INSERT (ID_ENTITY, ID_VAR, LANGUAGE) values ​​(?,?,?)", (Str (IDE), var_res, var_type), strag ID_var = id_var + 1 #

    "Start transaction" and "Commit" (ID_WR) + "_" + str (ID), "N" Allows


    what is cur.execute ("start") and cur.execute ("commit" ) Is the statement correctly placed?

    If the statements are for at the same level , then they are in the right place, but you also have to determine when cur.execute () . < If / Code> calls, then no commitment will be made to do anything other than any code to algorithm_level .

    You should not use cur.execute ("commit") , but conn.commit () hence the driver can see that you What are they doing.

    Start is not really necessary either. If none, then the database will automatically start a transaction for you, then it would be better:

      conn.isolation_level = '...' # is nothing but no code : # For handle transaction management = conn.cursor () for ... Cur.execute (...)  

php - how post method of form actually work behind scene -


I have both received / posted and have information about the differences between both security and security for both .

Okay, when we get the method, we're getting data from the query string and it's okay.

Now, for the post:

We call one .php, we are giving variable names that are in the form with method = "post" and we get it $ _POST ['Name'] with two.php, where this name is actually stored between these 2 pages and from where it actually comes and able to get it with a $ _POST ?

"post-text" itemprop = "text">

value In the request is deposited.

  • Headers
  • Body
  • Important difference between a GET and a post. The matter is that GET has no physical body, so any data you want to include in GET is required to be included on the address. A post, however, is a body and contains key / value pairs for that body's values.

    Take a look at your browser's debugging tool and check for requests / reactions when interacting with the server. For a post request, you will see that you can actually inspect the values ​​(which you may want to consider when discussing the "security" of these requests. ..)

    The prices are not specially "stored" anywhere they work almost exactly as they do a GET request. They are just in the second part of the request format.


    logging - Could someone help me with the server log interpretation? -


    I know what standard server log looks like, however, sometimes I get logs that make me a bit confused (I am analyzing data figures). For example:

    www-phalcon2 66.249.78.168 - [20 / f / 2015: 23: 59: 59 +0100] 200 3251 4.6 9 0.001 192.168.64.125 3557 " GET /style/products.css?1414645533 http / 1.1 "" - "" - "" Mozilla / 5.0 (compatible; Googlebot / 2.1; +) "

    belongs to the first IP client. But what about other people? What stands for "www.phalcon2" (in general)? Also, what are the two values ​​after the number of transferred bytes?

    I am sure that such logs are easy to interpret, but I have done my research on the internet and I did not get the answer. Thanks for your help!

    It looks like a W3C compatible log and is quite standard. The interesting thing about W3C formats is that they have a title where each line is before #. The file will look something like this:

      # warson: 1.0 # date: 12-January -1996 00:00:00 # field: time CS-method CS-Yury  < / Pre> 

    If you can search flat for the rows starting with # (you may have to search all the time), then with the same source type you can get the definition as an example without the definition, You can not actually parse that log.

    An option is believed to be an Apache custom log format (which is not usually the header). In this case you will have to ask for a logformatt or custom log configuration - this will give you a string called string - basically, a series of% elements that represent the format simultaneously. You can find.

    I think the decimal number is the time taken for making requests in both seconds (% T round) and microsounds (% D - more precision). However, this is an estimate which is generally available in logging libraries - without the configuration or header information, you can not really say.


    c - Function to read in a word into a struct array -



    c - Function to read in a word into a struct array -

    i having error code using, wondering if help debug. seems getting malloc error. thanks.

    void readwords(char norm_word[maxsize], word ** array) { int = 0; bool found = false; int result = 0; word * current_pointer = malloc (sizeof(word*));//creates temporary variable each pointer in array (i=0; i<word_counter; i++) { current_pointer = *(array+i); //accesses current pointer result = strcmp(norm_word, (current_pointer -> word)); //compares string each stored string if (result == 0) { found = true; (current_pointer->freq)++; break; } } if(!found) { if(pointer_counter == word_counter) { array = realloc(array, sizeof(array)*2); pointer_counter*=2; } word * new_pointer = (word*) malloc (sizeof(word*)); strcpy(new_pointer -> word, norm_word); *(array + (pointer_counter - 1)) = new_pointer; word_counter++; } ; }

    all pointers have same size on system. sizeof returns same size pointer. want allocate structure, need utilize sizeof on name without star. malloc homecoming pointer block of memory afterwards.

    here short implementation:

    #include <iostream> #include <string> typedef struct { int num; int numnum; }numbers; int main(int argc, char ** argv) { numbers* n = (numbers*)malloc(sizeof(numbers)); n->num = 1; n->numnum = 2; free(n); homecoming 0; }

    c arrays struct malloc

    ddwrt iptables issue - I want to forward all traffic to an external proxy -



    ddwrt iptables issue - I want to forward all traffic to an external proxy -

    i have external squid 3 proxy server in florida. in michigan. want tunnel traffic through router proxy server in florida. sure need iptables not getting it. have read ddwrt transparent proxy wiki , problem proxy server not on same subnet - it's external public ip. there tutorial out there can help me improve understand this?

    my router ip 192.168.1.1 , proxy 69.29.x.x

    i tried this:

    proxy_ip=69.29.x.x proxy_port=6000 lan_ip=`nvram lan_ipaddr` lan_net=$lan_ip/`nvram lan_netmask` iptables -t nat -a prerouting -i br0 -s $lan_net -d $lan_net -p tcp --dport 80 -j take iptables -t nat -a prerouting -i br0 -p tcp --dport 80 -j dnat --to $proxy_ip:$proxy_port iptables -t nat -i postrouting -o br0 -s $lan_net -d $proxy_ip -p tcp -j snat --to $lan_ip iptables -i forwards -i br0 -o br0 -s $lan_net -d $proxy_ip -p tcp --dport $proxy_port -j take

    internet works lan ports not redirected transparently squid proxy server. not understand above. got http://phinfinity.com/2012/09/20/setting-up-a-transparent-pass-through-proxy-with-iptables/

    proxy external tunnel

    Convert JSON object to Java bean using org.json package -



    Convert JSON object to Java bean using org.json package -

    i have java bean class, example:

    public class user implements serializable{ protected string name = null; protected string password = null; // ... }

    i can convert org.json object using

    user u = new user(); u.setname("aaa"); u.setpassword("123"); jsonobject jo = new jsonobject(u);

    is way convert jsonobject java bean class?

    there no built-in way using json.org library.

    depending on needs, can either

    write fromjsonobject() method each of beans, uses jsonobject#has() , jsonobject#get*() needed values , handle type problems. write global method uses jsonobject#names() , reflection populate bean instance info jsonobject. not difficult, heavy lifting if need utilize couple of bean classes.

    java json

    mysql - PHP mysqli not adding column (ALTER TABLE) via a variable -



    mysql - PHP mysqli not adding column (ALTER TABLE) via a variable -

    i'm trying add together column table using next code. not letting me insert column name via variable ($document_type).

    $document_type=$_post['document_type']; $category=$_post['category']; $file_extension=$_post['file_extension']; // database insert $sql_link = connect_mysqli_db(); $stmt1 = $sql_link->prepare("insert document_type (document_type,category,file_extension) values (?,?,?)"); $stmt1->bind_param('sss',$document_type,$category,$file_extension); if($stmt1->execute()){ //problem here $sql_link->query("alter table hr_types add together $document_type varchar(255) null"); }

    if type column name statically works. variable noting happens, not error. tried can think of.

    this should work. :)

    $sql_link->query("alter table `hr_types` add together `{$document_type}` varchar(255) null");

    php mysql mysqli

    angularjs - Angular-Fullstack - grunt build not including javascript files -



    angularjs - Angular-Fullstack - grunt build not including javascript files -

    ok post question on angular-fullstack's issue list on github can check out there see if there additional posts aren't on here. git hub question

    basically i'm getting next output in console:

    get http://localhost:8080/assets/images/loading.gif 404 (not found) (index):60 http://localhost:8080/app/assignment-meeting/prepare-senior/candidate/profile/_profile-ctrl.js (index):102 http://localhost:8080/app/assignment-meeting/prepare-senior/candidate-list/candidates-list-controller.js (index):100 http://localhost:8080/app/assignment-meeting/prepare-senior/candidate/_candidate-ctrl.js (index):101 http://localhost:8080/app/assignment-meeting/prepare-senior/candidate/summary/_summary-ctrl.js (index):103 http://localhost:8080/app/home/home-controller.js (index):104 http://localhost:8080/components/services/candidate-services.js (index):109 http://localhost:8080/components/auth/user.js (index):106 http://localhost:8080/app/routes.js (index):105 http://localhost:8080/components/directives/napi-ck-editor.js (index):108 http://localhost:8080/components/auth/user-service.js (index):107 http://localhost:8080/components/services/http-helper.js (index):110 http://localhost:8080/components/services/menu-services.js 404 (not found)

    it seems grunt build can't find script files located within injector sections of index.html page. if recopy created index.html file generator created , re-create of code above "google analytics" section over, work fine. don't understand why doesn't work doesn't seem show there beingness actual difference in code. page doesn't show single line beingness different. thing thought might causing problem line endings might getting changed when commit git , has issues. truthfully i'm in dark on one. post question on couple different forms i'm tired of retyping it...so if want read git hub post (link above), might improve worded.

    thanks help.

    update:

    sorry should have attached grunt file read , noted there's grunt.registertask called "build." didn't attach because haven't changed default 1 made angular-fullstack , figure other view reference...but attaching simpler , better:

    'use strict'; module.exports = function (grunt) { // configurable paths application var appconfig = { app: require('./bower.json').apppath || 'client', dist: 'src/main/webapp' }; // load grunt tasks automatically, when needed require('jit-grunt')(grunt, { useminprepare: 'grunt-usemin', ngtemplates: 'grunt-angular-templates', cdnify: 'grunt-google-cdn', protractor: 'grunt-protractor-runner', injector: 'grunt-asset-injector' }); // require('load-grunt-tasks')(grunt); // time how long tasks take. can help when optimizing build times require('time-grunt')(grunt); // define configuration tasks grunt.initconfig({ // project settings pkg: grunt.file.readjson('package.json'), yeoman: { // configurable paths client: require('./bower.json').apppath || 'client', dist: 'src/main/webapp' }, watch: { bower: { files: ['bower.json'], tasks: ['wiredep'] }, injectjs: { files: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js', '!<%= yeoman.client %>/app/app.js'], tasks: ['injector:scripts'] }, injectcss: { files: [ '<%= yeoman.client %>/{app,components}/**/*.css' ], tasks: ['injector:css'] }, jstest: { files: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ], tasks: ['newer:jshint:all', 'karma'] }, injectsass: { files: [ '<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'], tasks: ['injector:sass'] }, sass: { files: [ '<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'], tasks: ['sass', 'autoprefixer'] }, gruntfile: { files: ['gruntfile.js'] }, livereload: { files: [ '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.css', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.html', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js', '<%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}' ], options: { livereload: true } } }, // actual grunt server settings connect: { options: { port: 9000, // alter '0.0.0.0' access server outside. hostname: 'localhost' }, livereload: { options: { open: true, middleware: function (connect) { homecoming [ connect.static('.tmp'), connect().use( '/client/bower_components', connect.static('./client/bower_components') ), connect.static(appconfig.app) ]; } } }, test: { options: { port: 9001, middleware: function (connect) { homecoming [ connect.static('.tmp'), connect.static('test'), connect().use( '/client/bower_components', connect.static('./client/bower_components') ), connect.static(appconfig.app) ]; } } }, dist: { options: { open: true, base: '<%= yeoman.dist %>' } } }, // create sure code styles par , there no obvious mistakes jshint: { options: { jshintrc: '<%= yeoman.client %>/.jshintrc', reporter: require('jshint-stylish') }, all: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js' ], test: { src: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ] } }, // empties folders start fresh clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*', '!<%= yeoman.dist %>/.openshift', '!<%= yeoman.dist %>/procfile' ] }] }, server: '.tmp' }, // add together vendor prefixed styles autoprefixer: { options: { browsers: ['last 1 version'] }, dist: { files: [{ expand: true, cwd: '.tmp/', src: '{,*/}*.css', dest: '.tmp/' }] } }, // automatically inject bower components app wiredep: { target: { src: '<%= yeoman.client %>/index.html', ignorepath: '<%= yeoman.client %>/', exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/', /bootstrap.css/, /font-awesome.css/ ] } }, // renames files browser caching purposes rev: { dist: { files: { src: [ '<%= yeoman.dist %>/public/{,*/}*.js', '<%= yeoman.dist %>/public/{,*/}*.css', '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', '<%= yeoman.dist %>/public/assets/fonts/*' ] } } }, // reads html usemin blocks enable smart builds automatically // concat, minify , revision files. creates configurations in memory // additional tasks can operate on them useminprepare: { html: ['<%= yeoman.client %>/index.html'], options: { dest: '<%= yeoman.dist %>/public', flow: { html: { steps: { js: ['concat', 'uglifyjs'], css: ['cssmin'] }, post: {} } } } }, cssmin: { options: { root: 'client' } }, // performs rewrites based on rev , useminprepare configuration usemin: { html: ['<%= yeoman.dist %>/public/{,*/}*.html'], css: ['<%= yeoman.dist %>/public/{,*/}*.css'], js: ['<%= yeoman.dist %>/public/{,*/}*.js'], options: { assetsdirs: [ '<%= yeoman.dist %>/public', '<%= yeoman.dist %>/public/assets/images' ], // update image references in our ng-templates patterns: { js: [ [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'update js reference our revved images'] ] } } }, // next *-min tasks produce minified files in dist folder imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.{png,jpg,jpeg,gif}', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, // htmlmin: { // dist: { // options: { // collapsewhitespace: true, // conservativecollapse: true, // collapsebooleanattributes: true, // removecommentsfromcdata: true, // removeoptionaltags: true // }, // files: [{ // expand: true, // cwd: '<%= yeoman.dist %>', // src: ['*.html', 'app/**/*.html'], // dest: '<%= yeoman.dist %>' // }] // } // }, // uglify: { // dist: { // files: { // '<%= yeoman.dist %>/scripts/scripts.js': [ // '<%= yeoman.dist %>/scripts/scripts.js' // ] // } // } // }, svgmin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.svg', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, // allow utilize of non-minsafe angularjs files. automatically makes // minsafe compatible uglify not destroy ng references ngannotate: { dist: { files: [{ expand: true, cwd: '.tmp/concat', src: '*/**.js', dest: '.tmp/concat' }] } }, // bundle html partials single javascript payload ngtemplates: { options: { // should name of apps angular module module: 'napirest', htmlmin: { collapsebooleanattributes: true, collapsewhitespace: true, removeattributequotes: true, removeemptyattributes: true, removeredundantattributes: true, removescripttypeattributes: true, removestylelinktypeattributes: true }, usemin: 'app/app.js' }, main: { cwd: '<%= yeoman.client %>', src: ['{app,components}/**/*.html'], dest: '.tmp/templates.js' }, tmp: { cwd: '.tmp', src: ['{app,components}/**/*.html'], dest: '.tmp/tmp-templates.js' } }, // replace google cdn references cdnify: { dist: { html: ['<%= yeoman.dist %>/public/*.html'] } }, // copies remaining files places other tasks can utilize copy: { dist: { files: [{ expand: true, dot: true, cwd: '<%= yeoman.client %>', dest: '<%= yeoman.dist %>/public', src: [ '*.{ico,png,txt}', '.htaccess', 'bower_components/**/*', 'assets/images/{,*/}*.{webp}', 'assets/fonts/**/*', 'index.html' ] }, { expand: true, cwd: '.tmp/images', dest: '<%= yeoman.dist %>/public/assets/images', src: ['generated/*'] }, { expand: true, dest: '<%= yeoman.dist %>', src: [ 'package.json' ] }] }, styles: { expand: true, cwd: '<%= yeoman.client %>', dest: '.tmp/', src: ['{app,components}/**/*.css'] } }, // run tasks in parallel speed build process concurrent: { server: [ 'sass' ], test: [ 'sass' ], dist: [ 'sass', 'imagemin', 'svgmin' ] }, // test settings karma: { unit: { configfile: 'karma.conf.js', singlerun: true } }, mochatest: { options: { reporter: 'spec' }, src: ['server/**/*.spec.js'] }, protractor: { options: { configfile: 'protractor.conf.js' }, chrome: { options: { args: { browser: 'chrome' } } } }, // compiles sass css sass: { server: { options: { loadpath: [ '<%= yeoman.client %>/bower_components', '<%= yeoman.client %>/app', '<%= yeoman.client %>/components' ], compass: false }, files: { '.tmp/app/app.css' : '<%= yeoman.client %>/app/app.scss' } } }, injector: { options: { }, // inject application script files index.html (doesn't include bower) scripts: { options: { transform: function(filepath) { filepath = filepath.replace('/client/', ''); filepath = filepath.replace('/.tmp/', ''); homecoming '<script src="' + filepath + '"></script>'; }, starttag: '<!-- injector:js -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}/app/app.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js'] ] } }, // inject component scss app.scss sass: { options: { transform: function(filepath) { filepath = filepath.replace('/client/app/', ''); filepath = filepath.replace('/client/components/', ''); homecoming '@import \'' + filepath + '\';'; }, starttag: '// injector', endtag: '// endinjector' }, files: { '<%= yeoman.client %>/app/app.scss': [ '<%= yeoman.client %>/{app,components}/**/*.{scss,sass}', '!<%= yeoman.client %>/app/app.{scss,sass}' ] } }, // inject component css index.html css: { options: { transform: function(filepath) { filepath = filepath.replace('/client/', ''); filepath = filepath.replace('/.tmp/', ''); homecoming '<link rel="stylesheet" href="' + filepath + '">'; }, starttag: '<!-- injector:css -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ '<%= yeoman.client %>/{app,components}/**/*.css' ] } } } }); // used delaying livereload until after server has restarted grunt.registertask('wait', function () { grunt.log.ok('waiting server reload...'); var done = this.async(); settimeout(function () { grunt.log.writeln('done waiting!'); done(); }, 3000); }); grunt.registertask('serve', function (target) { if (target === 'dist') { homecoming grunt.task.run(['build', 'wait', 'connect:dist:keepalive']); } grunt.task.run([ 'clean:server', 'injector:sass', 'concurrent:server', 'injector', 'wiredep', 'autoprefixer', 'connect:livereload', 'wait', 'watch' ]); }); grunt.registertask('server', function () { grunt.log.warn('the `server` task has been deprecated. utilize `grunt serve` start server.'); grunt.task.run(['serve']); }); grunt.registertask('test', function(target) { if (target === 'client') { homecoming grunt.task.run([ 'clean:server', 'injector:sass', 'concurrent:test', 'injector', 'autoprefixer', 'karma' ]); } else if (target === 'e2e') { homecoming grunt.task.run([ 'clean:server', 'injector:sass', 'concurrent:test', 'injector', 'wiredep', 'autoprefixer', 'connect:test', 'protractor' ]); } else grunt.task.run([ 'test:client' ]); }); grunt.registertask('build', [ 'clean:dist', 'injector:sass', 'concurrent:dist', 'injector', 'wiredep', 'useminprepare', 'autoprefixer', 'ngtemplates', 'concat', 'ngannotate', 'copy:dist', 'cdnify', 'cssmin', 'uglify', 'rev', 'usemin' ]); grunt.registertask('default', [ 'newer:jshint', 'test', 'build' ]); };

    i've encountered xactly same problem here. after hours of file file comparison. i've solved it. thought share has worked me.

    i'm working on windows, , alter line ending unix style "index.html" in text editor (i'm using sublime text way) solve problem. "windows" line ending create script bug seems.

    hope help.

    meg4mi

    javascript angularjs gruntjs bower

    android - Changing name of app in PlayStore -



    android - Changing name of app in PlayStore -

    i had app in playstore named "abc def", , found when searching "abc def".

    now unpublished app, , cannot found anymore - far, good.

    now uploaded new app named "abc_def" (the same name above, underline), , can found when searching "abc_def".

    but changed name of new app "abc def", , cannot find when searching "abc def", when searching "abc_def", though name of app updated in playstore (not in developer console).

    does take google time refresh search index, or did wrong?

    you need alter name of app both places: google play developer console , in application before compiling apk , re-upload google play. have done already?

    android rename google-play

    windows runtime - WinRT embedded assets can only have known/specific file extensions? -



    windows runtime - WinRT embedded assets can only have known/specific file extensions? -

    in developing winrt 8.1 app, think uri has of known file extensions? correct? example, next snippet cause exception on getfilefromapplicationuriasync phone call if file exists shown:

    class="lang-cs prettyprint-override">uri uri = new uri("ms-appx:///assets/lake800x600.flanker"); storagefile file = await storagefile.getfilefromapplicationuriasync(uri).astask().configureawait(false);

    however, if alter file extension , uri '.dat' or '.txt' works fine. known issue? why can't refer , utilize files of extension?

    you need create sure files marked content included in appx package.

    typical info file types such .txt , .jpg default content, you'll need set explicitly other file types.

    compare text file:

    and .dat file:

    you can confirm creating bundle (store.create app packages...), renaming .appx .zip, , opening see files. can check appx folder created in app's bin\debug\appx directory when deploy , run visual studio

    windows-runtime uri assets

    android - Access view of other layout -



    android - Access view of other layout -

    i have 1 mainactivity , 2 fragments namely input.java , output.java. want access textview located @ output_layout in input fragment (more precisely, if click on button in input_layout, textview of output_layout should change). how can this? calling these input_layout , out_put layout dynamically in main_activity.

    as beginner, pardon ignorance. help highly appreciated. in advance.

    try utilize interfaces. example.

    public interface onoutputfragmenttextchanger { public void onchangetext(string what); }

    in onattach method of input.class next:

    @override public void onattach(activity activity) { super.onattach(activity); // makes sure container activity has implemented // callback interface. if not, throws exception seek { mcallback = (onoutputfragmenttextchanger) activity; } grab (classcastexception e) { throw new classcastexception(activity.tostring() + " must implement onoutputfragmenttextchanger"); } }

    and in yours onclicklistener phone call mcallback.onchangetext("foooo");

    next in output class create method

    public void updateinputview(string what) { mtextview.settext(what); }

    next implement onoutputfragmenttextchanger in activity , override method onchangetext(string what):

    public class mainactivity extends fragmentactivity implements onoutputfragmenttextchanger { //do somwthing @override public void onchangetext(string what) { inputfragment inputfragment = (inputfragment) getsupportfragmentmanager().findfragmentbyid(r.id.fragment); // or seek findfragmentbytag if (inputfragment != null) { inputfragment.updateinputview("some string"); } } }

    android android-fragments android-fragmentactivity

    ios - UILabel with Gesture Recognizer inside UITableViewCell blocks didSelectRowAtIndexPath -



    ios - UILabel with Gesture Recognizer inside UITableViewCell blocks didSelectRowAtIndexPath -

    i utilize uilabels uitapgesturerecognizer within uitableviewcell. gesturerecognizer works well. when tap on label, want didselectrowatindexpath: should execute too. or indexpathforselectedrow() method should give me selected row.

    setting cancelstouchesinview = false did not work!

    is possible? right indexpathforselectedrow() method returns nil.

    why using uitapgesturerecognizer? if want utilize that, seek set tag of label label.tag=indexpath.row. might value looking at. regarding own opinion, i'd remove uitapgesturerecognizer , straight utilize didselectrowatindexpath method..

    edit 2:

    try using solution..it might help you..

    -(void)handletap:(uitapgesturerecognizer *)sender { cgpoint location = [sender locationinview:self.view]; if (cgrectcontainspoint([self.view convertrect:self.yourtableview.frame fromview:self.tableview.superview], location)) { cgpoint locationintableview = [self.yourtableview convertpoint:location fromview:self.view]; nsindexpath *indexpath = [self.yourtableview indexpathforrowatpoint:locationintableview]; if (indexpath) [self tableview:self.yourtableview didselectrowatindexpath:indexpath]; return; } }

    ios uitableview uilabel uitapgesturerecognizer didselectrowatindexpath

    java - Sorting an arraylist of jsonobjects on a particular json element -



    java - Sorting an arraylist of jsonobjects on a particular json element -

    i have written code creates array list of json info using gson library looks this.

    { "filename": "somefile.mp3" "artist": "artist1" "title": "title1" "genre": "rock" } { "filename": "anotherfile.mp3" "artist": "artist2" "title": "title2" "genre": "electro" }

    im trying figure out how can sort array list artist element. ordering in way created via filename. reading on stackoverflow suggests should trying utilize custom comparator. ive been looking @ reply (how sort gson array based on key?) not working me.

    i have custom class called tracks.class has getters , setters set holding title,artist,genre etc

    trackfilemanager.class serializer , jsonobject.addproperty code , returns jsonobject mainactivity.

    this jsonobject gets added arraylist called values below in mainactivity. (listoffiles array list holds filenames of mp3s)

    final gsonbuilder gsonbuilder = new gsonbuilder(); gsonbuilder.registertypeadapter(track.class, new trackfilemanager()); gsonbuilder.setprettyprinting(); //diasablehtmlescaping stops & turning \u0026 final gson gson = gsonbuilder.disablehtmlescaping().create(); values = new arraylist<string>(); (string file : listoffiles){ t = new track(path,file); values.add(gson.tojson(t)); } collections.sort(values, new myjsoncomparator());

    the other code have myjsoncomparator.class below

    public class myjsoncomparator implements comparator<string> { @override public int compare(string s1, string s2) { homecoming s1.compareto(s2); } }

    this produces no errors doesnt sort know wont way not hint errors in android studio. if alter code implements comparator<track> collections.sort produces error. , unless have comparator can't access elements want sort on s1.getartist etc unless thats not right way it?? i've tried arraylist<string> , pretty much other combinations of types except 1 works.

    im doing wrong, im pretty sure im there. can help or @ to the lowest degree point me in right direction?

    edit

    public class myjsoncomparator implements comparator<track> { @override public int compare(track s1, track s2) { homecoming s1.artist.compareto(s2.artist); } }

    the above code causes collections.sort(values,new myjsoncomparator()); error.

    sort (list<string>, java.util.comparator<? super java.lang.string> in collections cannot applied arraylist<string>, com.example.myjsoncomparator.

    your compare function should take objects input

    @override public int compare(object s1, object s2) { homecoming s1.artist.compareto(s2.artist); }

    collection.sort work on list ,having objects implementing same comparator interface.

    refer below link http://www.programcreek.com/2011/12/examples-to-demonstrate-comparable-vs-comparator-in-java/

    java android json arraylist gson

    javascript - Hubspot File Uploading using PHP-Hubspot API -



    javascript - Hubspot File Uploading using PHP-Hubspot API -

    i have been using hubspot client inbound marketing , email campaigns. have managed forms,email templates,workflows etc in hubspot using php api. in need upload file using hubspot.

    currently i'm next method mentioned here(following php example)

    http://developers.hubspot.com/docs/methods/forms/submit_form

    i have file upload button along other fields. while searching solution, saw this:

    http://help.hubspot.com/articles/kcs_article/can-i-add-a-file-upload-field-to-my-forms

    following step described there, able add together file upload button, when checked submissions, no upload details there.

    can 1 guide me how implement in  php / javascript environment.

    perhaps uploads have been successful you're not looking in right place them? form uploads on hubspot stored contact , not submission entries. can follow these instructions find them:

    navigate contacts > contacts home search name of contact file want retrieve > click name open contact record click properties on left-hand side of page locate appropriate file upload property click button next property (looks box arrow in it) > file open

    instructions from: http://help.hubspot.com/articles/kcs_article/contacts/how-do-i-find-the-file-that-my-contact-uploaded-with-a-form-submission

    if mistaken, perhaps can post form's html code?

    javascript php hubspot

    c++ - Exec program that needs sudo privilages -



    c++ - Exec program that needs sudo privilages -

    so end goal run programme on beaglebone black on boot (add init file) exec other programs. other programs beingness started need sudo privileges start. research, have seen couple of ways don't know 1 "correct". point me in right direction?

    here code testing right start 1 of many programs:

    #include <iostream> #include <unistd.h> using std::cout; using std::cin; int main() { pid_t pid; pid = fork(); if (0 == pid) { setreuid(geteuid(), getuid()); execl("/usr/local/bin/osmo-trx", "osmo-trx", "-f", null); cout << "\n\n***something went wrong starting osmo-trx***\n\n"; } else if (0 < pid) ; else { cout << "\n\nsomething went wrong...\n\n"; homecoming -1; } homecoming 0; }

    i'm having problem figuring out right question. here have though may way off path should take.

    can exec programme sudo privileges? tried the uid no luck.

    if give debian user root privileges, able run program? tried editing visudo , adding debian no success. below file:

    # # file must edited 'visudo' command root. # # please consider adding local content in /etc/sudoers.d/ instead of # straight modifying file. # # see man page details on how write sudoers file. # defaults env_reset defaults mail_badpass defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # host alias specification # user alias specification # cmnd alias specification # user privilege specification root all=(all:all) debian all=(all:all) # allow members of grouping sudo execute command %sudo all=(all:all) # see sudoers(5) more info on "#include" directives: #includedir /etc/sudoers.d %admin all=(all) all</code>

    --note: sorry epic indentation editor giving me problem highlighting code.--

    please help...

    c++ linux debian exec sudo